Description
Describe the bug
Adding the @nuxthub/core
module to the project breaks the nuxt build
command, but the errors come from a different module.
This might have something to do with the cloudflare-pages
preset for nitro 🤔
My Nuxt 3 project with deployment to NuxtHub worked fine until I tried to add the @reown/appkit packages for crypto wallets functionality.
I'm not quite sure if this is the right place to submit an issue (could be the @reown/appkit
problem), but removing the @nuxthub/core
module does fix the problem and allows the build
command to run successfully.
The error itself is quite cryptic:
Cannot resolve "pino-pretty" from "/my-app/node_modules/pino/lib/tools.js" and externals are not allowed!
Installing pino
and pino-pretty
does not resolve the issue.
I have also tried adding this configuration in my nuxt.config.ts
, but this led me to another "externals" error:
nitro: {
rollupConfig: {
external: ['pino', 'pino-pretty'],
},
},
experimental: {
clientNodeCompat: true,
},
Cannot resolve "node:string_decoder/" from "/app/node_modules/keccak/node_modules/readable-stream/lib/_stream_readable.js" and externals are not allowed!
Steps to reproduce
A minimal reproducible example on StackBlitz: https://stackblitz.com/edit/nuxt-starter-ksablssm?file=nuxt.config.ts
Running npm run build
causes the described issue. Removing the @nuxthub/core
makes the npm run build
command run successfully again.
The setup of both packages is minimal and based on examples copied from the documentation.
Expected behavior
npm run build
/nuxt build
command executes successfully.