I am using vite build --watch to build a website, the initial bundling works fine. But the subsequent changes lead to hanging on transforming.
- Rollup Plugin Name: commonjs
- Rollup Plugin Version: 24.0.1
- Rollup Version: v3.20.0
- Operating System (or Browser): Windows 11
- Node Version: 19
- Link to reproduction (⚠️ read below):
I have spent hours on this issue but failed to create a minimal reproduction. So I may need your help to construct one.
However, I traced down to a probable cause. See additional information.
Expected Behavior
Changes are built as expected.
Actual Behavior
Stuck on transforming.
Additional Information
In my case, there are multiple ?commonjs-proxy loading at the same time, which might have led to:
- More than
maxParallelFileOps loading of ?commonjs-proxy modules happen at once.
- Those loading calls queued nested jobs in the
fileOperationQueue but the queue is already at max concurrency.
- The nested jobs have to wait for jobs running in the queue to finish, but the running jobs are also waiting for the nested jobs to finish.
- Dead lock.
|
if (isWrappedId(id, PROXY_SUFFIX)) { |
|
const actualId = unwrapId(id, PROXY_SUFFIX); |
|
return getStaticRequireProxy(actualId, getRequireReturnsDefault(actualId), this.load); |
|
} |
https://github.com/rollup/rollup/blob/d44fba668e6d7a89725b8bcd82d6af655f7372b4/src/ModuleLoader.ts#L261-L264
source = await this.graph.fileOperationQueue.run(
async () =>
(await this.pluginDriver.hookFirst('load', [id])) ?? (await readFile(id, 'utf8'))
);
I am using
vite build --watchto build a website, the initial bundling works fine. But the subsequent changes lead to hanging on transforming.I have spent hours on this issue but failed to create a minimal reproduction. So I may need your help to construct one.
However, I traced down to a probable cause. See additional information.
Expected Behavior
Changes are built as expected.
Actual Behavior
Stuck on transforming.
Additional Information
In my case, there are multiple
?commonjs-proxyloading at the same time, which might have led to:maxParallelFileOpsloading of?commonjs-proxymodules happen at once.fileOperationQueuebut the queue is already at max concurrency.plugins/packages/commonjs/src/index.js
Lines 295 to 298 in bc5cf91
https://github.com/rollup/rollup/blob/d44fba668e6d7a89725b8bcd82d6af655f7372b4/src/ModuleLoader.ts#L261-L264