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]: Storybook has stopped loading TypeError: (0 , import_common.handlebars) is not a function #29559

Open
paullewisn opened this issue Nov 6, 2024 · 2 comments

Comments

@paullewisn
Copy link

Describe the bug

Storybook has been working fine for me for weeks, until today. No new changes. Now it refuses to start.

I have tried storybook dev -p 6006 and npx storybook@latest init, I have also cleared my node modules and reinstalled.

> storybook dev --no-open --quiet -p 6006

@storybook/core v8.4.2

WARN The following packages are incompatible with Storybook 8.4.2 as they depend on different major versions of Storybook packages:
WARN - @storybook/[email protected] (8.4.2 available!)
WARN  Repo: https://github.com/storybookjs/storybook/tree/next/code/addons/essentials
WARN - @storybook/[email protected] (8.4.2 available!)
WARN  Repo: https://github.com/storybookjs/storybook/tree/next/code/addons/interactions
WARN - @storybook/[email protected] (8.4.2 available!)
WARN  Repo: https://github.com/storybookjs/storybook/tree/next/code/frameworks/nextjs
WARN - @storybook/[email protected] (8.4.2 available!)
WARN  Repo: https://github.com/storybookjs/storybook/tree/next/code/renderers/react
WARN - @storybook/[email protected] (8.4.2 available!)
WARN  Repo: https://github.com/storybookjs/storybook/tree/next/code/lib/test
WARN Please consider updating your packages or contacting the maintainers for compatibility details.
WARN For more on Storybook 8 compatibility, see the linked GitHub issue:
WARN https://github.com/storybookjs/storybook/issues/26031

info Found existing addon "@storybook/addon-controls", skipping.
info Found existing addon "@storybook/addon-viewport", skipping.
info Found existing addon "@storybook/addon-controls", skipping.
info Found existing addon "@storybook/addon-viewport", skipping.
info => Serving static files from ././public at /
=> Failed to build the preview
TypeError: (0 , import_common.handlebars) is not a function
    at getVirtualModules (./node_modules/@storybook/builder-webpack5/dist/presets/preview-preset.js:1:3007)
    at async iframe_webpack_config_default (./node_modules/@storybook/builder-webpack5/dist/presets/preview-preset.js:6:222)
    at async starter (./node_modules/@storybook/builder-webpack5/dist/index.js:1:6115)
    at async Module.start (./node_modules/@storybook/builder-webpack5/dist/index.js:1:9902)
    at async storybookDevServer (./node_modules/@storybook/core/dist/core-server/index.cjs:36000:11)
    at async buildOrThrow (./node_modules/@storybook/core/dist/core-server/index.cjs:35017:12)
    at async buildDevStandalone (./node_modules/@storybook/core/dist/core-server/index.cjs:37190:78)
    at async withTelemetry (./node_modules/@storybook/core/dist/core-server/index.cjs:35757:12)
    at async dev (./node_modules/@storybook/core/dist/cli/bin/index.cjs:2591:3)
    at async s.<anonymous> (./node_modules/@storybook/core/dist/cli/bin/index.cjs:2643:74)

WARN Broken build, fix the error above.
WARN You may need to refresh the browser.

Reproduction link

None

Reproduction steps

No response

System

System:
OS: macOS 14.7.1
CPU: (10) arm64 Apple M1 Max
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.9.0 - ~/.nvm/versions/node/v22.9.0/bin/node
Yarn: 4.4.0 - /opt/homebrew/bin/yarn <----- active
npm: 10.8.3 - ~/.nvm/versions/node/v22.9.0/bin/npm
Browsers:
Chrome: 130.0.6723.92
Safari: 17.6
npmPackages:
@storybook/addon-essentials: ^8.2.9 => 8.2.9
@storybook/addon-interactions: ^8.2.9 => 8.2.9
@storybook/addon-links: ^8.2.9 => 8.2.9
@storybook/addon-onboarding: ^8.2.9 => 8.2.9
@storybook/blocks: ^8.2.9 => 8.2.9
@storybook/nextjs: ^8.2.9 => 8.2.9
@storybook/react: ^8.2.9 => 8.2.9
@storybook/test: ^8.2.9 => 8.2.9
@storybook/types: ^8.2.9 => 8.2.9
eslint-plugin-storybook: ^0.8.0 => 0.8.0
msw-storybook-addon: ^2.0.4 => 2.0.4
storybook: ^8.2.9 => 8.4.2

Additional context

No response

@paullewisn
Copy link
Author

Fixing the version to 8.2.9 seems to cure it

@shilman
Copy link
Member

shilman commented Nov 7, 2024

We removed handlebars in 8.4 to slim down our package install size. I would recommend upgrading all your packages to 8.4, or fixing the version to 8.2 as you've done. In your log you're running [email protected] but 8.2.9 of the rest of the packages.

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

No branches or pull requests

2 participants