You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Build storybook stories with webpack5 configuration. E.g.,
storybook build --webpack-stats-json
@storybook/cli v7.6.19
info => Cleaning outputDir: /storybook-static
info => Loading presets
info => Building manager..
info => Manager built (1.92 s)
info => Building preview..
info => Copying static files:
...
info Using SWC compiler
info Addon-docs: using MDX2
info => Using implicit CSS loaders
...
info => Using default Webpack5 setup
The build fails with errors similar to the one below:
Module build failed (from ../../node_modules/.pnpm/@storybook[email protected]/node_modules/@storybook/addon-coverage/dist/cjs/loader/webpack5-istanbul-loader.js): Error: .inputSourceMap must be a boolean, object, or undefined
at transformSync (/node_modules/.pnpm/@babel[email protected]/node_modules/@babel/core/lib/transform.js:42:76)
at Instrumenter.instrumentSync (/node_modules/.pnpm/[email protected]/node_modules/istanbul-lib-instrument/src/instrumenter.js:102:25)
at Object._default (/node_modules/.pnpm/@storybook[email protected]/node_modules/@storybook/addon-coverage/dist/cjs/loader/webpack5-istanbul-loader.js:36:29)
Expected behavior
The string type source map should be parsed into an object which is then fed into the code instrumentation.
Describe the bug
A regression in v1.0.4 when loading source maps of type string in webpack5 instanbul loader
Steps to reproduce the behavior
Build storybook stories with webpack5 configuration. E.g.,
@storybook/cli v7.6.19
info => Cleaning outputDir: /storybook-static
info => Loading presets
info => Building manager..
info => Manager built (1.92 s)
info => Building preview..
info => Copying static files:
...
info Using SWC compiler
info Addon-docs: using MDX2
info => Using implicit CSS loaders
...
info => Using default Webpack5 setup
The build fails with errors similar to the one below:
Module build failed (from ../../node_modules/.pnpm/@storybook[email protected]/node_modules/@storybook/addon-coverage/dist/cjs/loader/webpack5-istanbul-loader.js):
Error: .inputSourceMap must be a boolean, object, or undefined
at transformSync (/node_modules/.pnpm/@babel[email protected]/node_modules/@babel/core/lib/transform.js:42:76)
at Instrumenter.instrumentSync (/node_modules/.pnpm/[email protected]/node_modules/istanbul-lib-instrument/src/instrumenter.js:102:25)
at Object._default (/node_modules/.pnpm/@storybook[email protected]/node_modules/@storybook/addon-coverage/dist/cjs/loader/webpack5-istanbul-loader.js:36:29)
Expected behavior
The string type source map should be parsed into an object which is then fed into the code instrumentation.
Please view the patch I have contributed #44.
Screenshots and/or logs
Please refer to sample error above
Environment
Additional context
A very similar issue was previously reported here #32, and fixed in #33.
However, it was reintroduced as part of Fix sourcemap generation for Webpack5 projects.
The text was updated successfully, but these errors were encountered: