Could not resolve "vue" (and lots more) while deploying Nuxt 4 project as a CF Worker

Im trying to deploy nuxt 4 on cloudflare worker, that previously worked as a CF Pages. It works fine locally. but when deploying I see a bunch of errors like this. I've tried adding to nitro externals.external and external.inline. But I don't see why package.json and pnpm-lock aren't dealing with this. I have SSR: true, not sure if that matters.
14:35:08.681 ╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14:35:08.681
14:35:08.682 You can mark the path "@vue/server-renderer" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.
14:35:08.682
14:35:08.682
14:35:08.682 ✘ [ERROR] Could not resolve "@vue/server-renderer"
14:35:08.682
14:35:08.682 .output/server/chunks/build/LibBaseImg-DV7dxmXv.mjs:3:113:
14:35:08.682 3 │ ...Class, ssrInterpolate, ssrRenderSlot } from '@vue/server-renderer';
14:35:08.682 ╵ ~~~~~~~~~~~~~~~~~~~~~~
14:35:08.682
14:35:08.682 The module "./dist/server-renderer.esm-bundler.js" was not found on the file system:
14:35:08.682
14:35:08.682 .output/server/node_modules/@vue/server-renderer/package.json:21:16:
14:35:08.682 21 │ "import": "./dist/server-renderer.esm-bundler.js",
14:35:08.682 ╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14:35:08.682
14:35:08.683 You can mark the path "@vue/server-renderer" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.
14:35:08.681 ╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14:35:08.681
14:35:08.682 You can mark the path "@vue/server-renderer" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.
14:35:08.682
14:35:08.682
14:35:08.682 ✘ [ERROR] Could not resolve "@vue/server-renderer"
14:35:08.682
14:35:08.682 .output/server/chunks/build/LibBaseImg-DV7dxmXv.mjs:3:113:
14:35:08.682 3 │ ...Class, ssrInterpolate, ssrRenderSlot } from '@vue/server-renderer';
14:35:08.682 ╵ ~~~~~~~~~~~~~~~~~~~~~~
14:35:08.682
14:35:08.682 The module "./dist/server-renderer.esm-bundler.js" was not found on the file system:
14:35:08.682
14:35:08.682 .output/server/node_modules/@vue/server-renderer/package.json:21:16:
14:35:08.682 21 │ "import": "./dist/server-renderer.esm-bundler.js",
14:35:08.682 ╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14:35:08.682
14:35:08.683 You can mark the path "@vue/server-renderer" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?