You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
identifier "__worker_exports__" has already been declared #191
Whenever I try to call a function exported by the file in the Workers directory, I get a build error. It works fine in dev, but fails during the build process. Since i tried to build the playground which works just fine, im curios if if did something wrong.
its company code so its hard to give a full repro
im using Nuxt 4.2.0
🔍 What have you tried?
i tried to just have a function like the hi example from the playground
export function fetchHeaders() {
return "success";
}
ℹ️ Additional context
[nuxi 12:08:01 AM] ERROR Nuxt Build Error: [vite:worker-import-meta-url] app/workers/fetchHeaders.ts (61:6): Identifier "worker_exports" has already been declared
file: /app/workers/fetchHeaders.ts:61:6 (virtual:nuxt-workers.mjs?source=2Fapp%2Fworkers%2FfetchHeaders.ts)
at getRollupError (node_modules/rollup/dist/es/shared/parseAst.js:401:41)
at error (node_modules/rollup/dist/es/shared/parseAst.js:397:42)
at Module.error (node_modules/rollup/dist/es/shared/node-entry.js:16939:16)
at ModuleScope.addDeclaration (node_modules/rollup/dist/es/shared/node-entry.js:5540:21)
at ModuleScope.addDeclaration (node_modules/rollup/dist/es/shared/node-entry.js:15040:22)
at Identifier.declare (node_modules/rollup/dist/es/shared/node-entry.js:5425:35)
at VariableDeclarator.declareDeclarator (node_modules/rollup/dist/es/shared/node-entry.js:13042:17)
at VariableDeclaration.initialise (node_modules/rollup/dist/es/shared/node-entry.js:15397:24)
at convertNode (node_modules/rollup/dist/es/shared/node-entry.js:16337:10)
at convertNodeList (node_modules/rollup/dist/es/shared/node-entry.js:16347:38)
Activity
yan-yanishevsky commentedon Jan 23, 2026
A similar error for Rolldown happened to me when I tried
compatibilityVersion: 5in nuxt configchore(deps): upgrade vite to 8, mlt-core to 0.9, cql2 to 0.5.6 (#916)