N
Nuxt15mo ago
fsyntax

Weird RollupError on running `nuxi build`

Hey everyone! Im trying to build a Nuxt 3 / Prismic app with the cloudflare_pages preset enabled (I also tried other cloudflare presets). The build runs fine, but after the prerendering process I get this error:
ℹ Building Nitro Server (preset: cloudflare_pages) nitro 10:36:49
(node-resolve plugin) Could not resolve import "unenv/runtime/mock/proxy-cjs/" in C:\Users\marco.freiberger\WebstormProjects\aromapflegekongress\node_modules\.pnpm\[email protected]\node_modules\tough-cookie\lib\cookie.js using exports defined in C:\Users\marco.freiberger\WebstormProjects\aromapflegekongress\node_modules\.pnpm\[email protected]\node_modules\unenv\package.json.
(inject plugin) rollup-plugin-inject: failed to parse C:/Users/marco.freiberger/WebstormProjects/aromapflegekongress/node_modules/.pnpm/[email protected]/node_modules/canvas/build/Release/canvas.node. Consider restricting the plugin to particular files via options.include

ERROR RollupError: Unexpected character '�' (Note that you need plugins to import files that are not

1: MZ�♥♦���@►☺▼�� �!�☺L�!This program cannot be run in DOS mode.
^
2: $�������������
3: �����

 ELIFECYCLE  Command failed with exit code 1.
ℹ Building Nitro Server (preset: cloudflare_pages) nitro 10:36:49
(node-resolve plugin) Could not resolve import "unenv/runtime/mock/proxy-cjs/" in C:\Users\marco.freiberger\WebstormProjects\aromapflegekongress\node_modules\.pnpm\[email protected]\node_modules\tough-cookie\lib\cookie.js using exports defined in C:\Users\marco.freiberger\WebstormProjects\aromapflegekongress\node_modules\.pnpm\[email protected]\node_modules\unenv\package.json.
(inject plugin) rollup-plugin-inject: failed to parse C:/Users/marco.freiberger/WebstormProjects/aromapflegekongress/node_modules/.pnpm/[email protected]/node_modules/canvas/build/Release/canvas.node. Consider restricting the plugin to particular files via options.include

ERROR RollupError: Unexpected character '�' (Note that you need plugins to import files that are not

1: MZ�♥♦���@►☺▼�� �!�☺L�!This program cannot be run in DOS mode.
^
2: $�������������
3: �����

 ELIFECYCLE  Command failed with exit code 1.
When building via nuxi generate, the build finishes successfully, but when testing it with wrangler pages dev /dist, the content of the routes doesnt seem to change. I've found this (https://github.com/nuxt/nuxt/issues/15057) issue on Github, but I can see where this error is related to my project.. Help is much appreciated 🙏
GitHub
Unexpected character '�' when generating build · Issue #15057 · n...
Environment Operating System: Windows_NT Node Version: v16.17.0 Nuxt Version: 3.0.0-rc.11 Nitro Version: 0.5.4 Package Manager: [email protected] Builder: vite Reproduction I Tried to reproduce but looks ...
5 Replies
fsyntax
fsyntaxOP15mo ago
Traced the issue down - it was caused by a package called vue-email
Bootsmann
Bootsmann15mo ago
hva you tried adding
build: {
transpile: ["unenv/runtime/mock/proxy-cjs/"],
},
build: {
transpile: ["unenv/runtime/mock/proxy-cjs/"],
},
to your nuxt.config? 🙂 or maybe with the vue-email
fsyntax
fsyntaxOP15mo ago
It was indeed because vue-email wasnt configured for ssr. I just disabled it for now until i properly integrated it 🙂
Bootsmann
Bootsmann15mo ago
okay 🙂 i've had similar issues with ssr, and the transpile could fix some errors during ssr
NeoPrint3D
NeoPrint3D6mo ago
did this ever get fixed? One thing I saw was the use of import-string odule which is causing the pnpapi error
Want results from more Discord servers?
Add your server