storybook: utility.assert is not a function
Describe the bug Storybook fails to build throwing the following errors:
TypeError: utility.assert is not a function
Error loading story index:
Error: Cannot parse JSDoc tags.
System
System: OS: macOS 12.0.1 CPU: (8) x64 Apple M1 Binaries: Node: 14.17.5 - ~/.nvm/versions/node/v14.17.5/bin/node Yarn: 1.22.17 - /usr/local/bin/yarn npm: 6.14.14 - ~/.nvm/versions/node/v14.17.5/bin/npm Browsers: Firefox: 96.0.3 Safari: 15.1 npmPackages: @storybook/addon-actions: 6.4.18 => 6.4.18 @storybook/addon-docs: 6.4.18 => 6.4.18 @storybook/addon-essentials: 6.4.18 => 6.4.18 @storybook/addon-links: 6.4.18 => 6.4.18 @storybook/addons: ^6.4.18 => 6.4.18 @storybook/builder-webpack5: 6.4.18 => 6.4.18 @storybook/manager-webpack5: 6.4.18 => 6.4.18 @storybook/react: 6.4.18 => 6.4.18 @storybook/testing-react: ^1.2.3 => 1.2.3
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 8
- Comments: 38 (10 by maintainers)
Commits related to this issue
- chore: fix storybook build see https://github.com/storybookjs/storybook/issues/17458 — committed to owid/owid-grapher by marcelgerber 2 years ago
Funny you mention that @csantos1113 https://github.com/storybookjs/storybook/pull/19341#issuecomment-1267980712
So this issue will be fixed in 7.0.
@shilman / @ndelangen should we patch this back to 6.5? (https://github.com/storybookjs/storybook/pull/19358)
I ended up disabling the
@storybook/addon-docsto get rid of the error. This can be done by replacing the'@storybook/addon-essentials'in the main config with the following:This isn’t a fix or workaround. It’s just a way to get rid of the error by disabling the add-on as described in docs.
alternatively, you can add a fallback to the webpackFinal config function and provide a polyfill.
In this case, you can add the commonjs-assert package.
Then add a property to the webpack final config in main.js
In any case going to close this as it is fixed in 7.0. Please try upgrading if you are still seeing problems!