[Bug] Production build breaks on npm update
bodograumann opened this issue · 5 comments
Describe the bug
After updating from 6.4.8 to 6.4.9, storybook production build breaks.
It seems to be unable to parse mdx files correctly.
I will have to look more deeply into this.
I also get the following error at the beginning of the log:
ERR! Addon value should end in /register OR it should be a valid preset https://storybook.js.org/docs/react/addons/writing-presets/
ERR! [object Object]
Relevant main.js. Removing the docs addon seems to fix the problem. I was not able to reproduce the issue in a clean project yet though.
module.exports = {
stories: ["../../src/**/*.stories.@(js|jsx|ts|tsx|mdx)"],
core: {
builder: "webpack5",
},
addons: [
{
name: "@storybook/addon-docs",
options: {
babelOptions: {
presets: [
[
"@vue/cli-plugin-babel/preset",
{
jsx: false,
},
],
],
},
},
},
],
};
Seems like the relevant change is that the @storybook/addon-docs
dependency is not flattened in package-lock.json, but only installed as node_modules/@storybook/addon-essentials/node_modules/@storybook/addon-docs
:
Previously in package-lock.json:
"node_modules/@storybook/addon-docs": {
Now:
"node_modules/@storybook/addon-essentials/node_modules/@storybook/addon-docs": {
Might this be related to npm 8.3.0?
Explicitely installing @storybook/addon-docs
besides @storybook/addon-essentials
works around the problem.
I guess in the default config this works fine, so this can probably not be fixed here :-|.