Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devServer() is executed twice #440

Closed
BugCreators opened this issue Jul 27, 2022 · 2 comments
Closed

devServer() is executed twice #440

BugCreators opened this issue Jul 27, 2022 · 2 comments
Assignees

Comments

@BugCreators
Copy link

craco.config.js like this

module.exports = {
  devServer: (devServerConfig, { env, paths, proxy, allowedHost }) => {
    devServerConfig.client.overlay.errors = false;

    // other...

    return devServerConfig;
  },
};

It works in 7.0.0-alpha.3, but when i upgrade to 7.0.0-alpha.7, I got the following error

(node:18104) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'overlay' of undefined

and i add console.log("devServerConfig", devServerConfig)

devServerConfig {}
devServerConfig {
  ...some configuration
}

As you see the function is called twice and the first time devServerConfig is empty

Is it expected behaviour?

@dilanx
Copy link
Owner

dilanx commented Jul 27, 2022

I just looked into it and it looks like this is a bug that I can fix. I will do that as soon as I can. Thanks for bearing with me as I work on this update and for catching this bug!

@dilanx dilanx self-assigned this Jul 27, 2022
@dilanx dilanx moved this to Investigate / Waiting in CRACO Tasks Jul 27, 2022
@dilanx dilanx moved this from Investigate / Waiting to To Do in CRACO Tasks Jul 27, 2022
@dilanx dilanx moved this from To Do to Done in CRACO Tasks Oct 2, 2022
@dilanx
Copy link
Owner

dilanx commented Oct 2, 2022

Just fixed this. It'll be in effect in alpha 8 which will be released sometime this week.

@dilanx dilanx closed this as completed Oct 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants