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

Nuxt fails after installing @nuxtjs/storybook #689

Closed
agantelin opened this issue Jul 11, 2024 · 10 comments · Fixed by #702
Closed

Nuxt fails after installing @nuxtjs/storybook #689

agantelin opened this issue Jul 11, 2024 · 10 comments · Fixed by #702
Labels
type: bug Something isn't working

Comments

@agantelin
Copy link

agantelin commented Jul 11, 2024

After installing @nuxtjs/storybook to an existing nuxt project, the command npm run dev fails with the error:

 ERROR  Error while requiring module @nuxtjs/storybook: Error: Cannot find module 'C:\p\project_name\node_modules\@nuxtjs\storybook\dist\module.cjs'                13:39:12  


 ERROR  Cannot start nuxt:  Cannot find module 'C:\p\project_name\node_modules\@nuxtjs\storybook\dist\module.cjs'                                                   13:39:12  

  at createEsmNotFoundErr (node:internal/modules/cjs/loader:1182:15)
  at finalizeEsmResolution (node:internal/modules/cjs/loader:1170:15)
  at resolveExports (node:internal/modules/cjs/loader:592:14)
  at Module._findPath (node:internal/modules/cjs/loader:669:31)
  at Module._resolveFilename (node:internal/modules/cjs/loader:1131:27)
  at Function.resolve (node:internal/modules/helpers:190:19)
  at Function._resolve [as resolve] (node_modules\jiti\dist\jiti.js:1:241814)
  at resolveModule (/C:/p/project_name/node_modules/@nuxt/kit/dist/index.mjs:2224:29)
  at requireModule (/C:/p/project_name/node_modules/@nuxt/kit/dist/index.mjs:2229:24)
  at loadNuxtModuleInstance (/C:/p/project_name/node_modules/@nuxt/kit/dist/index.mjs:2508:92)

Directory \node_modules@nuxtjs\storybook\ contains only node_modules dir & package.json file.
executing npm run build in this dir results to the error:

> @nuxtjs/storybook@8.1.2 build
> nuxt-module-build build

ℹ Building storybook                                                                                                                                                              13:46:40
ℹ Cleaning dist directory: ./dist                                                                                                                                                 13:46:40

 ERROR  Could not resolve entry module "src/module".                                                                                                                               13:46:40

  at error (/C:/p/project_name/node_modules/@nuxtjs/storybook/node_modules/unbuild/node_modules/rollup/dist/es/shared/node-entry.js:2287:30)
  at ModuleLoader.loadEntryModule (/C:/p/project_name/node_modules/@nuxtjs/storybook/node_modules/unbuild/node_modules/rollup/dist/es/shared/node-entry.js:24881:20)
  at async Promise.all (index 0)


 ERROR  Could not resolve entry module "src/module".   

Windows 11
node 20.15
npm 10.8.1
Nuxt 3.12.3 with Nitro 2.9.7
@nuxtjs/storybook 8.1.2

@321zeno
Copy link

321zeno commented Jul 11, 2024

Did you run npx storybook-nuxt init?

@Kreezag
Copy link

Kreezag commented Jul 11, 2024

The same issue
Mac Pro M1
node 22.4.1
yarn 1.12

nuxt: 3.12.3
@nuxtjs/storybook 8.1.2

Node throws an error on any command run (package installation, build, generate, running npx storybook-nuxt init)

UPD: repository to reproduce: https://github.com/buggregator/frontend, branch: dx/update-storybook-version

@tobiasdiez
Copy link
Collaborator

tobiasdiez commented Jul 11, 2024

Yes, for some reason the released package is completely empty: https://www.npmjs.com/package/@nuxtjs/storybook?activeTab=code. Sorry everyone! I promise, we are getting there eventually 😸

@chakAs3 could you please try it again? Please don't change the lock file locally (it broke ci again and may be the reason for the faulty release). If you still have these version issues, I'll try to resolve them before you release the next version.

@tobiasdiez tobiasdiez added the type: bug Something isn't working label Jul 11, 2024
@chakAs3
Copy link
Collaborator

chakAs3 commented Jul 12, 2024

@tobiasdiez The lockfile changes every time I run pnpm i, even though I haven't made any changes. This prevents the release from passing because the git status isn't clean. I will clone the repository again to get a fresh copy. and see what happens

@tobiasdiez
Copy link
Collaborator

Do you have an up to date pnpm?

@chakAs3
Copy link
Collaborator

chakAs3 commented Jul 12, 2024

Do you have an up to date pnpm?

that is what i doubt i guess i have 8.5.0, should it be 9.x ?

@tobiasdiez
Copy link
Collaborator

Yes! The easiest way is to use corepack enable pnpm which then will always use the Pnpm version specified in the package json

@chakAs3
Copy link
Collaborator

chakAs3 commented Jul 12, 2024

@tobiasdiez i have updated pnpm, lockfile is fine not touched, i ran pnpm release packages are published.

@chakAs3
Copy link
Collaborator

chakAs3 commented Jul 12, 2024

same issue the package is empty and no release pushed.

@tobiasdiez
Copy link
Collaborator

I think I've found the mistake. Hopefully fixed by #702.

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

Successfully merging a pull request may close this issue.

5 participants