Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: ERROR Cannot start nuxt: Nuxt module should be a function: @nuxtjs/color-mode #945

Open
2 tasks
rogadev opened this issue Dec 6, 2024 · 2 comments
Open
2 tasks
Labels
bug Something isn't working

Comments

@rogadev
Copy link
Contributor

rogadev commented Dec 6, 2024

Reproduction

https://stackblitz.com/edit/github-bbdmxt?file=nuxt.config.ts

Describe the bug

Attempting to run a Nuxt 3.7.4 app will fail with this error.

 ERROR  Cannot start nuxt:  Nuxt module should be a function: @nuxtjs/color-mode                                                       8:26:25 a.m.  

  at loadNuxtModuleInstance (/C:/Users/ryanr/Documents/dev/ezeval.app/node_modules/@nuxt/kit/dist/index.mjs:2466:11)
  at async installModule (/C:/Users/ryanr/Documents/dev/ezeval.app/node_modules/@nuxt/kit/dist/index.mjs:2389:47)
  at async setup (/C:/Users/ryanr/Documents/dev/ezeval.app/node_modules/shadcn-nuxt/dist/module.mjs:46:5)
  at async normalizedModule (/C:/Users/ryanr/Documents/dev/ezeval.app/node_modules/@nuxt/kit/dist/index.mjs:2140:17)
  at async installModule (/C:/Users/ryanr/Documents/dev/ezeval.app/node_modules/@nuxt/kit/dist/index.mjs:2397:95)
  at async initNuxt (/C:/Users/ryanr/Documents/dev/ezeval.app/node_modules/nuxt/dist/index.mjs:4684:5)
  at async NuxtDevServer._load (/C:/Users/ryanr/Documents/dev/ezeval.app/node_modules/nuxi/dist/chunks/dev2.mjs:1894:5)
  at async NuxtDevServer.load (/C:/Users/ryanr/Documents/dev/ezeval.app/node_modules/nuxi/dist/chunks/dev2.mjs:1828:7)
  at async NuxtDevServer.init (/C:/Users/ryanr/Documents/dev/ezeval.app/node_modules/nuxi/dist/chunks/dev2.mjs:1823:5)
  at async Object.run (/C:/Users/ryanr/Documents/dev/ezeval.app/node_modules/nuxi/dist/chunks/dev-child.mjs:104:5)

Only when you change the version of shadcn-nuxt to version 0.10.4 can you get your project to run.

    // package.json
    "shadcn-nuxt": "^0.10.4",

System Info

System:
    OS: Windows 11 10.0.26100
    CPU: (8) x64 Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz
    Memory: 63.32 GB / 79.94 GB
  Binaries:
    Node: 22.11.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 10.9.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.12.3 - ~\AppData\Local\pnpm\pnpm.CMD
  Browsers:
    Edge: Chromium (131.0.2903.70)
    Internet Explorer: 11.0.26100.1882
  npmPackages:
    nuxt: ^3.7.4 => 3.14.1592
    radix-vue: ^1.9.10 => 1.9.10
    shadcn-nuxt: 0.11.3 => 0.11.3
    vue: ^3.3.4 => 3.5.13

Contributes

  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests
@danielroe
Copy link
Contributor

The issue is that shadcn-nuxt does not depend on the module - you need to install it yourself:

https://github.com/unovue/shadcn-vue/blob/dev/packages/module/package.json#L48

The error message in Nuxt will make this clearer in the next version (v3.15) via nuxt/nuxt#30116.

@Us3r-gitHub
Copy link

Us3r-gitHub commented Dec 9, 2024

Related #864

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants