Barbapapazes / gavarnie

SaaS - Pre-configured and ready-to-use features to help you start your full-stack NuxtHub project faster.
https://gavarnie.barbapapazes.dev
MIT License
136 stars 12 forks source link

Updating deps breaks building for cloudflare pages #24

Closed GreenmeisterDavid closed 1 month ago

GreenmeisterDavid commented 1 month ago

Cloning the project, running pnpm update, adding the required env vars and running npx nuxthub deploy gives this error;


ℹ Building Nuxt Nitro server (preset: cloudflare-pages)                                                                                                                                                      nitro 12:05:02 PM

[nitro 12:05:05 PM]  ERROR  RollupError: node_modules/.cache/nuxt/.nuxt/dist/server/_nuxt/prompt-CfqaOWNS.js (1:9): "stdin" is not exported by "node_modules/.pnpm/unenv@1.10.0/node_modules/unenv/runtime/node/process/index.mjs", imported by "node_modules/.cache/nuxt/.nuxt/dist/server/_nuxt/prompt-CfqaOWNS.js".

1: import { stdin, stdout } from "node:process";
            ^
2: import f from "node:readline";
3: import { WriteStream } from "node:tty";

[12:05:05 PM]  ERROR  node_modules/.cache/nuxt/.nuxt/dist/server/_nuxt/prompt-CfqaOWNS.js (1:9): "stdin" is not exported by "node_modules/.pnpm/unenv@1.10.0/node_modules/unenv/runtime/node/process/index.mjs", imported by "node_modules/.cache/nuxt/.nuxt/dist/server/_nuxt/prompt-CfqaOWNS.js".

  at getRollupError (node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/parseAst.js:395:41)
  at error (node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/parseAst.js:391:42)
  at Module.error (node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/node-entry.js:15535:16)
  at Module.traceVariable (node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/node-entry.js:15984:29)
  at ModuleScope.findVariable (node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/node-entry.js:13770:39)
  at ChildScope.findVariable (node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/node-entry.js:5252:38)
  at ClassBodyScope.findVariable (node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/node-entry.js:5252:38)
  at ChildScope.findVariable (node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/node-entry.js:5252:38)
  at ChildScope.findVariable (node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/node-entry.js:5252:38)
  at FunctionScope.findVariable (node_modules/.pnpm/rollup@4.24.0/node_modules/rollup/dist/es/shared/node-entry.js:5252:38) 

[12:05:05 PM]  ERROR  node_modules/.cache/nuxt/.nuxt/dist/server/_nuxt/prompt-CfqaOWNS.js (1:9): "stdin" is not exported by "node_modules/.pnpm/unenv@1.10.0/node_modules/unenv/runtime/node/process/index.mjs", imported by "node_modules/.cache/nuxt/.nuxt/dist/server/_nuxt/prompt-CfqaOWNS.js".

 ERROR  Command failed with exit code 1: ./node_modules/.bin/nuxi build                                                                                                                                             12:05:05 PM

  at getFinalError (/Users/david/.npm/_npx/0fa85d1aa04cf089/node_modules/execa/lib/return/final-error.js:6:9)
  at makeError (/Users/david/.npm/_npx/0fa85d1aa04cf089/node_modules/execa/lib/return/result.js:108:16)
  at getAsyncResult (/Users/david/.npm/_npx/0fa85d1aa04cf089/node_modules/execa/lib/methods/main-async.js:167:4)
  at handlePromise (/Users/david/.npm/_npx/0fa85d1aa04cf089/node_modules/execa/lib/methods/main-async.js:150:17)
  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  at async Object.setup (/Users/david/.npm/_npx/0fa85d1aa04cf089/node_modules/nuxthub/src/commands/deploy.mjs:107:7)
  at async runCommand (/Users/david/.npm/_npx/0fa85d1aa04cf089/node_modules/citty/dist/index.mjs:288:5)
  at async runCommand (/Users/david/.npm/_npx/0fa85d1aa04cf089/node_modules/citty/dist/index.mjs:307:11)
  at async runMain (/Users/david/.npm/_npx/0fa85d1aa04cf089/node_modules/citty/dist/index.mjs:445:7) 

 ERROR  Command failed with exit code 1: ./node_modules/.bin/nuxi build

It seems like it's not building for deployment on Cloudflare as it tries to import stuff like import { stdin, stdout } from "node:process"; ? I played around a bit with this but haven't found the root cause yet - will update here when I find out more.

GreenmeisterDavid commented 1 month ago

Just gave this another shot and this issue seems fixed - maybe it was caching on my end or one of the updates done today? Anyway, closing this as its magically resolved ✨