onwidget/qwind

Cannot bundle Node.js built-in "fs" after adding cloudflare-pages

ThuKieuIC2 opened this issue · 1 comments

Good health all.
I got this error after adding cloudflare-pages plugin to deploy on Cloudflare Pages:
pnpm run qwik add cloudflare-pages
pnpm i && pnpm build
...
[commonjs--resolver] Cannot bundle Node.js built-in "fs" imported from "src/utils/posts.ts". Consider disabling ssr.noExternal or remove the built-in dependency.
error during build:
RollupError: Cannot bundle Node.js built-in "fs" imported from "src/utils/posts.ts". Consider disabling ssr.noExternal or remove the built-in dependency.
PLease help, thanks much

OKay FIXED, I update packson.json
replace
"build.server": "vite build -c adapters/cloudflare-pages/vite.config.ts",
by
"build.server": "vite build -c adapters/static/vite.config.ts",