Open dev-cetus opened 10 months ago
you can solve this by adding an additional piece in the config as follow
//https://nitro.unjs.io/config
export default defineNitroConfig({
preset: "cloudflare-pages",
rollupConfig: {
external: ["cloudflare:sockets"],
},
});
thanks it works, no more problem with cloudflare:sockets
! But now I have a problem with aws-sdk (although I don't deploy on aws)
Cannot resolve "aws-sdk" from "...\\node_modules\\.pnpm\\@mapbox+node-pre-gyp@1.0.11\\node_modules\\@mapbox\\node-pre-gyp\\lib\\util\\s3_setup.js" and externals are not allowed!
I did put this configuration in, as @ElioStalteri said:
nitro: {
preset: "cloudflare-pages",
rollupConfig: {
external: ["cloudflare:sockets"],
},
},
Environment
Reproduction
all code is here on powershell, run..
Describe the bug
When I build the app to deploy it to cloudflare workers, I get an error about "cloudflare:sockets" in the postgres package.
Cannot resolve "cloudflare:sockets" from "[...]\\node_modules\\.pnpm\\postgres@3.4.0\\node_modules\\postgres\\cf\\polyfills.js" and externals are not allowed!
Additional context
No response
Logs
No response