nuxt-hub / core

Build full-stack applications with Nuxt on CloudFlare, with zero configuration.
https://hub.nuxt.com
Apache License 2.0
993 stars 57 forks source link

Cannot build "hello-edge" template #377

Closed Kamsou closed 2 days ago

Kamsou commented 5 days ago

Describe the bug Heyoooo !

I've cloned your starter project https://github.com/nuxt-hub/hello-edge and tried to build but without success.

Steps to reproduce Steps to reproduce the behavior:

  1. git clone
  2. cd hello-clone
  3. pnpm i
  4. pnpm run dev
  5. pnpm build
  6. Have an error :
    
    [nitro 18:51:40]  ERROR  RollupError: node_modules/.cache/nuxt/.nuxt/dist/server/server.mjs (7:9): "CapoPlugin" is not exported by "../../.nvm/versions/node/v16.14.0/lib/node_modules/@nuxt/devtools/node_modules/unhead/dist/index.mjs", imported by "node_modules/.cache/nuxt/.nuxt/dist/server/server.mjs".

5: import { sanitizeStatusCode, createError as createError$1 } from "h3"; 6: import { setHeadInjectionHandler } from "@unhead/vue"; 7: import { CapoPlugin } from "unhead"; ^ 8: import { START_LOCATION, createMemoryHistory, createRouter as createRouter$1, RouterView } from "vue-router"; 9: import { toRouteMatcher, createRouter } from "radix3";

[18:51:40] ERROR node_modules/.cache/nuxt/.nuxt/dist/server/server.mjs (7:9): "CapoPlugin" is not exported by "../../.nvm/versions/node/v16.14.0/lib/node_modules/@nuxt/devtools/node_modules/unhead/dist/index.mjs", imported by "node_modules/.cache/nuxt/.nuxt/dist/server/server.mjs".

at getRollupError (node_modules/.pnpm/rollup@4.27.2/node_modules/rollup/dist/es/shared/parseAst.js:396:41) at error (node_modules/.pnpm/rollup@4.27.2/node_modules/rollup/dist/es/shared/parseAst.js:392:42) at Module.error (node_modules/.pnpm/rollup@4.27.2/node_modules/rollup/dist/es/shared/node-entry.js:15980:16) at Module.traceVariable (node_modules/.pnpm/rollup@4.27.2/node_modules/rollup/dist/es/shared/node-entry.js:16427:29) at ModuleScope.findVariable (node_modules/.pnpm/rollup@4.27.2/node_modules/rollup/dist/es/shared/node-entry.js:14210:39) at Identifier.bind (node_modules/.pnpm/rollup@4.27.2/node_modules/rollup/dist/es/shared/node-entry.js:5211:40) at CallExpression.bind (node_modules/.pnpm/rollup@4.27.2/node_modules/rollup/dist/es/shared/node-entry.js:2704:23) at CallExpression.bind (node_modules/.pnpm/rollup@4.27.2/node_modules/rollup/dist/es/shared/node-entry.js:11593:15) at ArrayExpression.bind (node_modules/.pnpm/rollup@4.27.2/node_modules/rollup/dist/es/shared/node-entry.js:2700:28) at ExpressionStatement.bind (node_modules/.pnpm/rollup@4.27.2/node_modules/rollup/dist/es/shared/node-entry.js:2704:23)

[18:51:40] ERROR node_modules/.cache/nuxt/.nuxt/dist/server/server.mjs (7:9): "CapoPlugin" is not exported by "../../.nvm/versions/node/v16.14.0/lib/node_modules/@nuxt/devtools/node_modules/unhead/dist/index.mjs", imported by "node_modules/.cache/nuxt/.nuxt/dist/server/server.mjs".



**Expected behavior**
Build OK
atinux commented 5 days ago

Can you please use Node 20 at least?

Kamsou commented 5 days ago

Can you please use Node 20 at least?

I'm on v20.18.0

atinux commented 3 days ago

Why do I see ../../.nvm/versions/node/v16.14.0/... then?

I guess you may have the Nuxt Devtools installed globally, make sure to install it locally then

Kamsou commented 2 days ago

Olala @atinux , thank you for putting me on the right track... I really didn't understand why it forced a version of node for Nuxt Devtools when I could change it just fine with nvm..

And then, I discovered the existence of the .nuxtrc file. It contained a configuration for a global installation of @nuxt/devtools with a specific version. I removed this and everything works fine now 🙏 Thanks again

atinux commented 2 days ago

My pleasure 🙂