craco
craco copied to clipboard
devServer() is executed twice
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?
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!
Just fixed this. It'll be in effect in alpha 8 which will be released sometime this week.