-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Optimizing dependencies in build mode fails with too many pending modules #13018
Comments
I can confirm in a large project too that #12851 (released in vite 4.3.0-beta.6) seems to make the |
Can you provide a mini-repro, I can't reproduce it 😢 |
Increased maxParallelFileOps due to a problem with vite and rollup vitejs/vite#13018
I'm also facing the same issue. The project was on vite |
This bit me today. Thanks for posting your solve @randypuro. @amalshaji I also arbitrarily set mine to 100 because im not even supposed to be in this area of my codebase 😂 🗺️ |
Describe the bug
The
optimizedDepsBuildPlugin
can result in a failed build if there are more than Rollup'smaxParallelFileOps
(default 20) awaiting optimization before the crawl has ended (which actually triggers the optimization). In the log lines below, note the 20 hanging module load operations.In my case, increasing up the
rollupOptions.maxParallelFileOps
solved the issue.Without understanding the details, I wonder if the issue is related to this recent pull request although I didn't use the feature before hand so can't say for certain.
Btw, I'm really bullish on this feature as it resolves a couple issues I was having seeing different behavior between dev and prod builds.
Reproduction
apologies
Steps to reproduce
Configure
optimizeDeps.disabled
to false andcommonjsOptions.include
to [] to enable the esbuild based dependency optimization.Have a handful of top level external dependencies requiring optimization (eg commonjs), and reduce
rollupOptions.maxParallelFileOps
to a number less than the number of dependencies.System Info
Used Package Manager
yarn
Logs
error during build:
Error: Unexpected early exit. This happens when Promises returned by plugins cannot resolve. Unfinished hook action(s) on exit:
(vite:optimized-deps-build) load "/zygote/node_modules/.vite/deps_build-d123dee8/react.js"
(vite:optimized-deps-build) load "/zygote/node_modules/.vite/deps_build-d123dee8/@emotion_react_jsx-runtime.js"
(vite:optimized-deps-build) load "/zygote/node_modules/.vite/deps_build-d123dee8/bootstrap.js"
(vite:optimized-deps-build) load "/zygote/node_modules/.vite/deps_build-d123dee8/@rails_ujs.js"
(vite:optimized-deps-build) load "/zygote/node_modules/.vite/deps_build-d123dee8/polished.js"
(vite:optimized-deps-build) load "/zygote/node_modules/.vite/deps_build-d123dee8/@emotion_react.js"
(vite:optimized-deps-build) load "/zygote/node_modules/.vite/deps_build-d123dee8/rollbar.js"
(vite:optimized-deps-build) load "/zygote/node_modules/.vite/deps_build-d123dee8/tippy__js.js"
(vite:optimized-deps-build) load "/zygote/node_modules/.vite/deps_build-d123dee8/focus-trap.js"
(vite:optimized-deps-build) load "/zygote/node_modules/.vite/deps_build-d123dee8/qs.js"
(vite:optimized-deps-build) load "/zygote/node_modules/.vite/deps_build-d123dee8/@emotion_styled.js"
(vite:optimized-deps-build) load "/zygote/node_modules/.vite/deps_build-d123dee8/react-map-gl.js"
(vite:optimized-deps-build) load "/zygote/node_modules/.vite/deps_build-d123dee8/choices__js.js"
(vite:optimized-deps-build) load "/zygote/node_modules/.vite/deps_build-d123dee8/@rails_activestorage.js"
(vite:optimized-deps-build) load "/zygote/node_modules/.vite/deps_build-d123dee8/focus-trap-react.js"
(vite:optimized-deps-build) load "/zygote/node_modules/.vite/deps_build-d123dee8/react-dom.js"
(vite:optimized-deps-build) load "/zygote/node_modules/.vite/deps_build-d123dee8/axios.js"
(vite:optimized-deps-build) load "/zygote/node_modules/.vite/deps_build-d123dee8/react_ujs.js"
(vite:optimized-deps-build) load "/zygote/node_modules/.vite/deps_build-d123dee8/react-dom_client.js"
(vite:optimized-deps-build) load "/zygote/node_modules/.vite/deps_build-d123dee8/@rollbar_react.js"
at EventEmitter.handleEmptyEventLoop (file:///zygote/node_modules/rollup/dist/es/shared/node-entry.js:24884:20)
at Object.onceWrapper (node:events:627:28)
at EventEmitter.emit (node:events:513:28)
at process. (file:///zygote/node_modules/rollup/dist/es/shared/node-entry.js:24878:55)
at process.emit (node:events:525:35)
pid 1776 exit 1
Build with Vite failed! ❌
Validations
The text was updated successfully, but these errors were encountered: