unenv icon indicating copy to clipboard operation
unenv copied to clipboard

[wrangler] "default" is not exported by "node_modules/unenv/runtime/polyfill/process.mjs"

Open jvbianchi opened this issue 8 months ago • 9 comments

Environment

cloudflare pages

Reproduction

try to deploy Nuxt to cloudflare pages using the /server/api/hello.ts folder with a simple test

export default defineEventHandler((_event) => {
  return {
    hello: "Hello from Server!!!",
  };
});

Describe the bug

"default" is not exported by "node_modules/unenv/runtime/polyfill/process.mjs"

Additional context

unenv-nightly version 1.10.0-1717606461.a117952

Logs

19:41:10.273	[info] [nitro] Building Nuxt Nitro server (preset: `cloudflare-pages`)
19:41:11.891	node_modules/std-env/dist/index.mjs (1:9): Error when using sourcemap for reporting an error: Can't resolve original location of error.
19:41:11.891	[error] [nitro] RollupError: node_modules/std-env/dist/index.mjs (1:9): "default" is not exported by "node_modules/unenv/runtime/polyfill/process.mjs", imported by "node_modules/std-env/dist/index.mjs".
19:41:11.892	
19:41:11.892	
19:41:11.892	1: import { default as process } from 'unenv/runtime/polyfill/process';
19:41:11.892	            ^
19:41:11.892	2: 
19:41:11.892	3: const r=Object.create(null),E=e=>globalThis.process?.env||globalThis._importMeta_.env||globalThis.Deno?.env.toObject(...
19:41:11.893	[error] node_modules/std-env/dist/index.mjs (1:9): "default" is not exported by "node_modules/unenv/runtime/polyfill/process.mjs", imported by "node_modules/std-env/dist/index.mjs".
19:41:11.894	  at getRollupError (node_modules/rollup/dist/es/shared/parseAst.js:396:41)
19:41:11.894	  at error (node_modules/rollup/dist/es/shared/parseAst.js:392:42)
19:41:11.894	  at Module.error (node_modules/rollup/dist/es/shared/node-entry.js:13858:16)
19:41:11.894	  at Module.traceVariable (node_modules/rollup/dist/es/shared/node-entry.js:14306:29)
19:41:11.894	  at ModuleScope.findVariable (node_modules/rollup/dist/es/shared/node-entry.js:11984:39)
19:41:11.894	  at Identifier.bind (node_modules/rollup/dist/es/shared/node-entry.js:6908:40)
19:41:11.894	  at UnaryExpression.bind (node_modules/rollup/dist/es/shared/node-entry.js:4775:23)
19:41:11.894	  at BinaryExpression.bind (node_modules/rollup/dist/es/shared/node-entry.js:4775:23)
19:41:11.895	  at LogicalExpression.bind (node_modules/rollup/dist/es/shared/node-entry.js:4775:23)
19:41:11.895	  at LogicalExpression.bind (node_modules/rollup/dist/es/shared/node-entry.js:4775:23) 
19:41:11.895	
19:41:11.895	[error] node_modules/std-env/dist/index.mjs (1:9): "default" is not exported by "node_modules/unenv/runtime/polyfill/process.mjs", imported by "node_modules/std-env/dist/index.mjs".
19:41:11.930	Failed: Error while executing user command. Exited with error code: 1

jvbianchi avatar Jun 16 '24 22:06 jvbianchi