You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: UNIFY-1774 error if component config is not sourced for webpack/vite (#21563)
* fix: UNIFY-1774, throw error if we do not detect a webpackConfig for the user
* remove dead code, rely on auto-sourcing webpack config
* fix error styles, exit the devServer process when config is missing, guard against empty remoteState
* Add missing webpack for todos project
* Update npm/webpack-dev-server/src/makeWebpackConfig.ts
Co-authored-by: Lachlan Miller <[email protected]>
Co-authored-by: Zachary Williams <[email protected]>
debug('Couldn\'t find a Vite config file, however we received a custom viteConfig',viteOverrides)
31
+
debug(`Couldn't find a Vite config file, however we received a custom viteConfig`,viteOverrides)
32
32
}else{
33
-
debug(`
34
-
Didn\'t resolve a Vite config AND the user didn\'t pass in a custom viteConfig.
35
-
Falling back to Vite\'s defaults.`)
33
+
if(config.onConfigNotFound){
34
+
config.onConfigNotFound('vite',root,configFiles)
35
+
// The config process will be killed from the parent, but we want to early exit so we don't get
36
+
// any additional errors related to not having a config
37
+
process.exit(0)
38
+
}else{
39
+
thrownewError(`Your component devServer config for vite is missing a required viteConfig property, since we could not automatically detect one.\n Please add one to your ${config.cypressConfig.configFile}`)
40
+
}
36
41
}
37
42
38
43
// Vite caches its output in the .vite directory in the node_modules where vite lives.
// The config process will be killed from the parent, but we want to early exit so we don't get
119
+
// any additional errors related to not having a config
120
+
process.exit(0)
121
+
}else{
122
+
thrownewError(`Your Cypress devServer config is missing a required webpackConfig property, since we could not automatically detect one.\nPlease add one to your ${config.devServerConfig.cypressConfig.configFile}`)
0 commit comments