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

Vite 3 - force-including unknown dependency bombs out #8841

Closed
7 tasks done
bholmesdev opened this issue Jun 28, 2022 · 2 comments
Closed
7 tasks done

Vite 3 - force-including unknown dependency bombs out #8841

bholmesdev opened this issue Jun 28, 2022 · 2 comments
Labels
feat: deps optimizer Esbuild Dependencies Optimization feat: ssr p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@bholmesdev
Copy link
Contributor

Describe the bug

In Vite 2, force-including an unknown dependency via optimizedDeps.include or ssr.noExternal would log a warning only. In Vite 3, the dev server / production build bombs out with the error:

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)

Reproduction

https://stackblitz.com/edit/vitejs-vite-ecaudg?file=vite.config.js&terminal=dev

System Info

System:
    OS: macOS 12.0.1
    CPU: (8) arm64 Apple M1
    Memory: 108.19 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 18.4.0 - ~/.nvm/versions/node/v18.4.0/bin/node
    Yarn: 1.22.18 - /usr/local/bin/yarn
    npm: 8.12.1 - ~/.nvm/versions/node/v18.4.0/bin/npm
  Browsers:
    Chrome: 103.0.5060.53
    Firefox: 95.0
    Safari: 15.1

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

@patak-dev patak-dev added p3-minor-bug An edge case that only affects very specific usage (priority) feat: ssr feat: deps optimizer Esbuild Dependencies Optimization and removed pending triage labels Jun 29, 2022
@btea
Copy link
Collaborator

btea commented Jul 7, 2022

It seems have been fixed by #8917

@bluwy
Copy link
Member

bluwy commented Jul 8, 2022

Can confirm running npm i vite@beta && npm run dev in the repro it's fixed.

@bluwy bluwy closed this as completed Jul 8, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jul 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feat: deps optimizer Esbuild Dependencies Optimization feat: ssr p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

No branches or pull requests

4 participants