storybook: [Storybook 6.4] Error loading story index
Describe the bug
During migration 6.3.12 -> 6.4.4 started getting this error on page load:
index.js:56 Error loading story index:
index.js:56 TypeError: Cannot read properties of undefined (reading 'type')
at normalizeInputType (normalizeInputTypes.js:24)
at mapValues.js:38
at _createBaseFor.js:17
at baseForOwn (_baseForOwn.js:13)
at mapValues (mapValues.js:37)
at normalizeInputTypes (normalizeInputTypes.js:44)
at processCSFFile (processCSFFile.js:54)
at StoryStore.memoizerific [as processCSFFileWithCache] (memoizerific.js:170)
at StoryStoreFacade.js:104
at Array.map (<anonymous>)
System
Environment Info:
System:
OS: macOS 12.0.1
CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
Binaries:
Node: 16.13.0 - /usr/local/Cellar/node@16/16.13.0/bin/node
Yarn: 1.22.17 - /usr/local/bin/yarn
npm: 8.1.0 - /usr/local/Cellar/node@16/16.13.0/bin/npm
Browsers:
Chrome: 96.0.4664.55
Firefox: 94.0.2
Safari: 15.1
npmPackages:
@storybook/addon-actions: ^6.4.4 => 6.4.4
@storybook/addon-controls: 6.4.4 => 6.4.4
@storybook/addon-docs: 6.4.4 => 6.4.4
@storybook/addon-essentials: ^6.4.4 => 6.4.4
@storybook/addon-links: ^6.4.4 => 6.4.4
@storybook/addons: 6.4.4 => 6.4.4
@storybook/codemod: 6.4.4 => 6.4.4
@storybook/react: 6.4.4 => 6.4.4
@storybook/storybook-deployer: ^2.8.10 => 2.8.10
.storybook/main.js
module.exports = {
stories: ['../src/components/**/*.stories.@(ts|tsx|js|jsx)'],
addons: [
{
name: '@storybook/addon-docs',
options: {
configureJSX: true,
},
},
'@storybook/addon-controls',
],
staticDirs: [
'../static'
],
typescript: {
check: false,
checkOptions: {},
reactDocgen: 'react-docgen-typescript',
reactDocgenTypescriptOptions: {
shouldExtractLiteralValuesFromEnum: true,
propFilter: (prop) => (prop.parent ? !/node_modules/.test(prop.parent.fileName) : true),
},
},
webpackFinal: config => {
return {
...config,
plugins: config.plugins.filter(plugin => {
// Remove the eslint-webpack-plugin: We already check our code, storybook doesn't need to bother
if (plugin.constructor.name === 'ESLintWebpackPlugin') {
return false
}
return true
}),
}
},
framework: "@storybook/react",
}
looks like this error was also seen in the alpha version: https://github.com/storybookjs/storybook/issues/16069
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 9
- Comments: 17 (6 by maintainers)
I get this error only with
storyStoreV7enabled (6.5.10)Can confirm I see the same.
6.4.0even shows the same behavior. Reverting to6.3.12makes things work again.Ran into this issue upgrading from storybook
6.4.22to6.5.10. Storybook runs fine, but I get this error when running Storyshot tests:Error loading story index&TypeError: fetch is not a functionI am encountering a similar issue when upgrading storybook from 6.3.12 to 6.4.*. The storybook source tab hangs on …loading source…
Updated from
6.3.12to6.5.9and still had this issue.Updated from
6.3.8to6.4.19and encountered this issue. AnargTypeset tonullwas the culprit just as it was for @pustovalov. I feel confident I can repro this and will probably set up something.We got this same error when we had
^6.1.9in our package.json for Storybook (/reactand/addon-a11y,addon-actions,addon-controls,/addon-docs,addon-essentials,addon-links,addon-storysourceand/addon-viewport).Changing them to
6.4.9,6.4.4, and6.4.0(without the^) did not work for us. We had to change them to6.3.12to resolve the error.I got this same error when I had version
^6.3.7in my package.json for Storybook (/reactandaddon-actions,addon-essentials,addon-linksandnode-logger). That actually installed Storybook 6.4.9 (as ^ in semver allows).But then when I changed the version to one without the caret, i.e. to
6.4.9(to all those packages), it started working again. So I wonder if the problem is with some incompatibilities between the addons and the main package that arise if they have different minor versions installed. I also tested6.4.0and6.4.4and they worked as well.