Skip to content

fix(compiler): update rollup to fix watch hang#6603

Merged
johnjenkins merged 1 commit intostenciljs:mainfrom
adrianschmidt:fix/rollup-watch-deadlock
Feb 18, 2026
Merged

fix(compiler): update rollup to fix watch hang#6603
johnjenkins merged 1 commit intostenciljs:mainfrom
adrianschmidt:fix/rollup-watch-deadlock

Conversation

@adrianschmidt
Copy link
Contributor

@adrianschmidt adrianschmidt commented Feb 18, 2026

What is the current behavior?

Watch mode rebuilds (stencil build --dev --watch --serve) hang indefinitely at generate lazy + source maps in projects with a large number of components. The rollup() 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 load pipeline simultaneously. The @rollup/plugin-commonjs load hook calls this.load() internally, and with maxParallelFileOps defaulting to 20, the outer load calls saturate the file operation queue while the nested this.load() calls queue behind them — deadlock.

The previous fix (PR #6255) exposed maxParallelFileOps as 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 maxParallelFileOps to Infinity (rollup/rollup#5986), eliminating the deadlock.

Watch mode rebuilds now complete normally.

Documentation

N/A

Does this introduce a breaking change?

  • Yes
  • No

Testing

Tested on lime-elements (280+ web components, 3687 modules in the Rollup graph):

  • Before: Rebuild hangs indefinitely at generate lazy + source maps. Instrumentation confirms rollup() is called with 3687 cached modules and maxParallelFileOps defaulting to 20, and never returns.
  • After disabling Rollup cache (workaround): Rebuild completes in ~7s, confirming the cache/queue interaction is the cause.
  • Rollup 4.44.0 fix: Removes the queue limit entirely, so cached rebuilds should be both fast and deadlock-free.

Other information

Copilot AI review requested due to automatic review settings February 18, 2026 19:23
@adrianschmidt adrianschmidt requested a review from a team as a code owner February 18, 2026 19:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 rollup from 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 maxParallelFileOps as a configuration option

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@adrianschmidt adrianschmidt force-pushed the fix/rollup-watch-deadlock branch from f55184d to 7b091b2 Compare February 18, 2026 19:27
Copilot AI review requested due to automatic review settings February 18, 2026 19:31
@adrianschmidt adrianschmidt force-pushed the fix/rollup-watch-deadlock branch from 7b091b2 to aec521a Compare February 18, 2026 19:31
@adrianschmidt adrianschmidt force-pushed the fix/rollup-watch-deadlock branch 2 times, most recently from 973b98e to 81fe17a Compare February 18, 2026 19:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@adrianschmidt adrianschmidt force-pushed the fix/rollup-watch-deadlock branch from 81fe17a to 4898637 Compare February 18, 2026 19:37
@adrianschmidt adrianschmidt changed the title fix(compiler): update Rollup to 4.44.0 to fix watch mode deadlock fix(compiler): update rollup to fix watch hang Feb 18, 2026
@johnjenkins johnjenkins added this pull request to the merge queue Feb 18, 2026
Merged via the queue into stenciljs:main with commit 205856b Feb 18, 2026
69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants