fix(compiler): update rollup to fix watch hang#6603
fix(compiler): update rollup to fix watch hang#6603johnjenkins merged 1 commit intostenciljs:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request updates the bundled Rollup dependency from version 4.34.9 to 4.44.0 to fix a critical deadlock issue in watch mode that affects projects with a large number of components (3000+ modules). The deadlock occurs because Rollup 4.34.9 defaults maxParallelFileOps to 20, causing cached modules to saturate the file operation queue during rebuilds, while nested this.load() calls from @rollup/plugin-commonjs queue behind them. Rollup 4.44.0 changes the default to Infinity, eliminating this bottleneck.
Changes:
- Updated
rollupfrom 4.34.9 to 4.44.0 - Updated all 8 platform-specific optional rollup dependencies to 4.44.0
- This complements PR #6255 which exposed
maxParallelFileOpsas a configuration option
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f55184d to
7b091b2
Compare
7b091b2 to
aec521a
Compare
973b98e to
81fe17a
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Stencil bundles Rollup 4.34.9, which contains a known deadlock bug (rollup/rollup#5848) that causes watch mode rebuilds to hang indefinitely at 'generate lazy + source maps'. The `@rollup/plugin-commonjs` `load` hook calls `this.load()` internally. With Rollup's `maxParallelFileOps` defaulting to 20, the outer load calls saturate the file operation queue, and the nested `this.load()` calls queue behind them — creating a deadlock. This is triggered on rebuild because Rollup passes all cached modules (3000+ in a large project) through the load pipeline simultaneously. Rollup 4.44.0 fixes this by changing the default `maxParallelFileOps` to Infinity (rollup/rollup#5986). fixes: stenciljs#6602
81fe17a to
4898637
Compare
What is the current behavior?
Watch mode rebuilds (
stencil build --dev --watch --serve) hang indefinitely atgenerate lazy + source mapsin projects with a large number of components. Therollup()call never returns.This is caused by a deadlock in the bundled Rollup 4.34.9 (rollup/rollup#5848): on rebuild, all cached modules (3000+ in a large project) are passed through the
loadpipeline simultaneously. The@rollup/plugin-commonjsloadhook callsthis.load()internally, and withmaxParallelFileOpsdefaulting to 20, the outerloadcalls saturate the file operation queue while the nestedthis.load()calls queue behind them — deadlock.The previous fix (PR #6255) exposed
maxParallelFileOpsas a config option but didn't change the default, so the deadlock still occurs out of the box.GitHub Issue Number: #6602
What is the new behavior?
Update the bundled Rollup from 4.34.9 to 4.44.0, which changes the default
maxParallelFileOpstoInfinity(rollup/rollup#5986), eliminating the deadlock.Watch mode rebuilds now complete normally.
Documentation
N/A
Does this introduce a breaking change?
Testing
Tested on lime-elements (280+ web components, 3687 modules in the Rollup graph):
generate lazy + source maps. Instrumentation confirmsrollup()is called with 3687 cached modules andmaxParallelFileOpsdefaulting to 20, and never returns.Other information