parcel-bundler/parcel · error · Error
No dynamic require possible: ${module}
Error message
No dynamic require possible: ${module} What it means
Thrown by Child.childInit when process.browser is true and the requested module is not '@parcel/core/src/worker.js'. In a browser bundle dynamic require() is impossible, so only the pre-bundled coreWorker reference is permitted; any other module name is rejected.
Source
Thrown at packages/core/workers/src/child.js:109
messageListener(message: WorkerMessage): Async<void> {
if (message.type === 'response') {
return this.handleResponse(message);
} else if (message.type === 'request') {
return this.handleRequest(message);
}
}
send(data: WorkerMessage): void {
this.child.send(data);
}
async childInit(module: string, childId: number): Promise<void> {
// $FlowFixMe
if (process.browser) {
if (module === '@parcel/core/src/worker.js') {
this.module = coreWorker;
} else {
throw new Error('No dynamic require possible: ' + module);
}
} else {
// $FlowFixMe this must be dynamic
this.module = require(module);
}
this.childId = childId;
if (this.module.childInit != null) {
await this.module.childInit();
}
}
async handleRequest(data: WorkerRequest): Promise<void> {
let {idx, method, args, handle: handleId} = data;
let child = nullthrows(data.child);
const responseFromContent = (content: any): WorkerDataResponse => ({
idx,View on GitHub (pinned to 59484858a1)
Solutions
- In browser builds, only request '@parcel/core/src/worker.js' as the child module.
- Bundle any required plugin worker under that module id, or move the work to a handle-based call.
- Run Parcel in Node where require(module) works for arbitrary modules.
Example fix
// before (browser)
child.childInit('./myPluginWorker.js', 0);
// after
child.childInit('@parcel/core/src/worker.js', 0); Defensive patterns
Strategy: validation
Validate before calling
if (process.browser && module !== '@parcel/core/src/worker.js') {
throw new Error(`Browser child init requires the core worker module, got ${module}`);
} Prevention
- In browser builds, only initialize the child with '@parcel/core/src/worker.js'.
- Bundle any plugin worker logic under that id or use handles.
- Keep arbitrary module child init on Node.
When it happens
Trigger: Initializing a worker child in a browser build with a module string other than the bundled core worker — e.g. a plugin that tries to load its own worker module in a browser context.
Common situations: Browser/web worker Parcel integrations; misconfigured bundling that includes the child worker code; plugins assuming Node dynamic require works in the browser.
Related errors
- No dynamic require possible: ${workerPath}
- No dynamic require possible: ${location}
- IDBCache is only supported in the browser
- Supplied WorkerFarm is ending
- More than one target is not supported in serve mode
AI-assisted analysis of parcel-bundler/parcel@59484858a1 (2026-08-13).
Data as JSON: /api/errors/79c8dbc5e6c5384c.
Report an issue: GitHub.