Vite 3 - force-including unknown dependency bombs out #8841
Labels
feat: deps optimizer
Esbuild Dependencies Optimization
feat: ssr
p3-minor-bug
An edge case that only affects very specific usage (priority)
Describe the bug
In Vite 2, force-including an unknown dependency via
optimizedDeps.include
orssr.noExternal
would log a warning only. In Vite 3, the dev server / production build bombs out with the error:Reproduction
https://stackblitz.com/edit/vitejs-vite-ecaudg?file=vite.config.js&terminal=dev
System Info
Used Package Manager
npm
Logs
Click to expand!
❯ npm run build $ vite build vite v3.0.0-beta.5 building for production... error during build: Error: Failed to resolve force included dependency: banana at addManuallyIncludedOptimizeDeps (file:///home/projects/vitejs-vite-ecaudg/node_modules/vite/dist/node/chunks/dep-332aa27f.js:38515:27) at async initialProjectDependencies (file:///home/projects/vitejs-vite-ecaudg/node_modules/vite/dist/node/chunks/dep-332aa27f.js:38313:5) at async initDepsOptimizer (file:///home/projects/vitejs-vite-ecaudg/node_modules/vite/dist/node/chunks/dep-332aa27f.js:37812:32) at async doBuild (file:///home/projects/vitejs-vite-ecaudg/node_modules/vite/dist/node/chunks/dep-332aa27f.js:43100:9) at async build (file:///home/projects/vitejs-vite-ecaudg/node_modules/vite/dist/node/chunks/dep-332aa27f.js:43062:16) at async CAC.eval (file:///home/projects/vitejs-vite-ecaudg/node_modules/vite/dist/node/cli.js:758:9)
Validations
The text was updated successfully, but these errors were encountered: