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/global' #26030

Closed
jwittekind opened this issue Feb 14, 2024 · 3 comments · Fixed by #26145
Closed

[Bug]: Cannot find module '@storybook/global' #26030

jwittekind opened this issue Feb 14, 2024 · 3 comments · Fixed by #26145

Comments

@jwittekind
Copy link

Describe the bug

Suddenly after reinstalling my node_modules i cannot start my storybook dev server again.
I'm not sure whether this is related to: #25130

Error: Cannot find module '@storybook/global'
    at webpackEmptyContext (http://localhost:4400/main.iframe.bundle.js:606:10)
    at ../../lib/channels/dist/index.js (http://localhost:4400/vendors-node_modules_storybook_addon-essentials_dist_actions_preview_js-node_modules_storyboo-9ff264.iframe.bundle.js:104060:26)
    at http://localhost:4400/vendors-node_modules_storybook_addon-essentials_dist_actions_preview_js-node_modules_storyboo-9ff264.iframe.bundle.js:100320:50
    at ./node_modules/@storybook/addon-actions/dist/index.js (http://localhost:4400/vendors-node_modules_storybook_addon-essentials_dist_actions_preview_js-node_modules_storyboo-9ff264.iframe.bundle.js:104410:31)
    at __webpack_require__ (http://localhost:4400/runtime~main.iframe.bundle.js:28:33)
    at fn (http://localhost:4400/runtime~main.iframe.bundle.js:338:21)
    at ./node_modules/storybook-addon-angular-router/dist/actionLoggingRouter.js (http://localhost:4400/vendors-node_modules_storybook_addon-essentials_dist_actions_preview_js-node_modules_storyboo-9ff264.iframe.bundle.js:142568:21)
    at __webpack_require__ (http://localhost:4400/runtime~main.iframe.bundle.js:28:33)
    at fn (http://localhost:4400/runtime~main.iframe.bundle.js:338:21)
    at ./node_modules/storybook-addon-angular-router/dist/withAngularRouter.js (http://localhost:4400/vendors-node_modules_storybook_addon-essentials_dist_actions_preview_js-node_modules_storyboo-9ff264.iframe.bundle.js:142777:28)

I'm Using angular in an nx monorepo and created a custom ui library with a storybook installation.

/my-monorepo
├── apps
└── libs
    └── my-ui
        ├── .storybook
        │   ├── main.ts
        │   ├── preview.ts
        │   ├── theme.ts
        │   ├── manager.ts
        │   └── tsconfig.json
        └── components
            └── ...

This is an excerpt of my package json:

{
    "devDependencies": {
        ...
        "@angular/cli": "~17.1.0",
        "@nx/angular": "17.3.2",
        "@nx/storybook": "17.3.2",
        "@storybook/addon-links": "^7.6.3",
        "@storybook/addon-essentials": "7.6.14",
        "@storybook/angular": "7.6.14",
        "@storybook/core-server": "7.6.14", 
        ...
    }
}

To Reproduce

No response

System

Storybook Environment Info:

  System:
    OS: macOS 14.3.1
    CPU: (10) arm64 Apple M1 Max
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.19.0 - ~/.nvm/versions/node/v18.19.0/bin/node
    npm: 10.4.0 - ~/.nvm/versions/node/v18.19.0/bin/npm <----- active
    pnpm: 8.15.1 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 121.0.6167.160
    Safari: 17.3.1
  npmPackages:
    @storybook/addon-essentials: ^7.6.15 => 7.6.15 
    @storybook/addon-links: ^7.6.15 => 7.6.15 
    @storybook/angular: ^7.6.15 => 7.6.15 
    @storybook/core-server: ^7.6.15 => 7.6.15 
    eslint-plugin-storybook: ^0.6.11 => 0.6.15 
    storybook-addon-angular-router: ^1.9.2 => 1.9.2

Additional context

No response

@jwittekind
Copy link
Author

Seems to be related to: Jakob-em/storybook-addon-angular-router#26

@vanessayuenn
Copy link
Contributor

we will be tracking this issue on #26126 so closing this one as dupe.

@vanessayuenn vanessayuenn closed this as not planned Won't fix, can't repro, duplicate, stale Feb 21, 2024
@yannbf
Copy link
Member

yannbf commented Feb 22, 2024

Hey there! Thank you so much for reporting. We created a fix for Storybook 8 and released a canary containing it which can be tested by running:

npx storybook@0.0.0-pr-26145-sha-32b8346f upgrade

Once the fix is confirmed and merged, we will patch it to Storybook 7.6 as well.

Would you mind testing it out and letting us know? 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants