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]: Cannot find module 'storybook/internal/common' #505

Open
eavam opened this issue Aug 16, 2024 · 8 comments
Open

[Bug]: Cannot find module 'storybook/internal/common' #505

eavam opened this issue Aug 16, 2024 · 8 comments
Labels
bug Something isn't working needs triage

Comments

@eavam
Copy link

eavam commented Aug 16, 2024

Describe the bug

Running yarn test-storybook responds with an error Cannot find module 'storybook/internal/common'.
On version 0.16 everything is fine. With 0.17 the problems start.

To Reproduce

node:internal/modules/cjs/loader:1147
  throw err;
  ^

Error: Cannot find module 'storybook/internal/common'
Require stack:
- <-- PATH -->/node_modules/@storybook/test-runner/node_modules/@storybook/core-common/shim.js
- <-- PATH -->/node_modules/@storybook/test-runner/dist/test-storybook.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (<-- PATH -->/node_modules/@storybook/test-runner/node_modules/@storybook/core-common/shim.js:1:18)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Module.require (node:internal/modules/cjs/loader:1235:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '<-- PATH -->/node_modules/@storybook/test-runner/node_modules/@storybook/core-common/shim.js',
    '<-- PATH -->/node_modules/@storybook/test-runner/dist/test-storybook.js'
  ]
}

System

System:
    OS: macOS 14.5
    CPU: (10) arm64 Apple M1 Max
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.10.0 - ~/.nvm/versions/node/v20.10.0/bin/node
    Yarn: 4.1.1 - ~/.nvm/versions/node/v20.10.0/bin/yarn <----- active
    npm: 10.2.3 - ~/.nvm/versions/node/v20.10.0/bin/npm
  Browsers:
    Chrome: 127.0.6533.120
    Safari: 17.5
  npmPackages:
    @storybook/addon-essentials: 8.1.1 => 8.1.1 
    @storybook/addon-interactions: 8.1.1 => 8.1.1 
    @storybook/addon-links: 8.1.1 => 8.1.1 
    @storybook/blocks: 8.1.1 => 8.1.1 
    @storybook/preview-api: 8.1.1 => 8.1.1 
    @storybook/react: 8.1.1 => 8.1.1 
    @storybook/react-vite: 8.1.1 => 8.1.1 
    @storybook/test: 8.1.1 => 8.1.1 
    @storybook/test-runner: 0.17.0 => 0.17.0 
    eslint-plugin-storybook: 0.8.0 => 0.8.0 
    msw-storybook-addon: 2.0.3 => 2.0.3 
    storybook: 8.1.1 => 8.1.1 
    storybook-addon-mock: 5.0.0 => 5.0.0

Additional context

No response

@eavam eavam added bug Something isn't working needs triage labels Aug 16, 2024
@kumarbha
Copy link

I am also facing the same issue. Pls help

@bklatka
Copy link

bklatka commented Aug 21, 2024

Facing same issue as above

@dudiharush
Copy link

Me too...

@dudiharush
Copy link

This bug seems to be resolved after running: npx [email protected] upgrade @eavam @kumarbha

@SoaresMG
Copy link

Same here, but I'm using [email protected] with @storybook/[email protected] (I have also tried 0.19.1).

I did upgrade other deps that's when the issue started happening, I'm trying to find which one caused it

@ericsoderberghp
Copy link

FYI, I've found that if I remove @storybook/addon-designs then the error goes away and I am able to run.

@SoaresMG
Copy link

Same here, but I'm using [email protected] with @storybook/[email protected] (I have also tried 0.19.1).

I did upgrade other deps that's when the issue started happening, I'm trying to find which one caused it

It seems that my issue was related with being in storybook@7 using [email protected] which had storybook@8 deps.

I switched to 0.16.0 and it started working again.

It was working before with storybook@7 due to the magic hand of the lock file god, that allowed some [email protected] deps to be mixed with storybook@7 itself (if I'm not mistaken it was some deps like @storybook/channels and @storybook/types and 1-2 more).

@sunilrathore24
Copy link

sunilrathore24 commented Sep 6, 2024

Same here -
it used to work earlier but probably because of some minor version upgrades, it fails with the below error.
@yannbf can you look into it?
image

  "devDependencies": {
    "@angular-devkit/build-angular": "18.0.2",
    "@angular-devkit/core": "18.0.2",
    "@angular-devkit/schematics": "18.0.2",
    "@angular-eslint/eslint-plugin": "18.0.1",
    "@angular-eslint/eslint-plugin-template": "18.0.1",
    "@angular-eslint/template-parser": "18.0.1",
    "@angular/cli": "~18.0.0",
    "@angular/compiler-cli": "18.0.1",
    "@angular/language-service": "18.0.1",
    "@babel/core": "^7.24.7",
    "@babel/plugin-proposal-decorators": "^7.24.7",
    "@babel/preset-env": "^7.24.7",
    "@babel/preset-typescript": "^7.24.7",
    "@commitlint/cli": "^17.0.2",
    "@commitlint/config-conventional": "^17.0.2",
    "@commitlint/prompt-cli": "^17.0.0",
    "@custom-elements-manifest/analyzer": "~0.5.7",
    "@mjhenkes/postcss-rtl": "^2.0.0",
    "@nx/cypress": "19.3.2",
    "@nx/eslint": "19.3.2",
    "@nx/eslint-plugin": "19.3.2",
    "@nx/js": "19.3.2",
    "@nx/storybook": "19.3.2",
    "@nx/workspace": "19.3.2",
    "@open-wc/testing": "^3.1.6",
    "@rollup/plugin-alias": "^5.1.0",
    "@rollup/plugin-node-resolve": "^15.2.3",
    "@rollup/plugin-terser": "^0.4.4",
    "@rollup/plugin-typescript": "^11.1.6",
    "@rollup/plugin-virtual": "^3.0.2",
    "@schematics/angular": "18.0.2",
    "@storybook/addon-a11y": "^8.1.7",
    "@storybook/addon-essentials": "^8.1.7",
    "@storybook/addon-webpack5-compiler-babel": "^3.0.3",
    "@storybook/angular": "^8.1.7",
    "@storybook/blocks": "^8.1.7",
    "@storybook/components": "^8.1.7",
    "@storybook/core-events": "^8.1.7",
    "@storybook/core-server": "^8.1.7",
    "@storybook/manager-api": "^8.1.7",
    "@storybook/preview-api": "^8.1.7",
    "@storybook/test-runner": "^0.19.1",
    "@storybook/theming": "^8.1.7",
    "@storybook/types": "^8.1.7",
    "@storybook/web-components": "^8.1.7",
    "@storybook/web-components-webpack5": "^8.1.7" }

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

No branches or pull requests

7 participants