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
TypeError: finalConfig.plugins.push is not a function
at exports.default (/Users/alvaropinot/foo/foo-Web/node_modules/@storybook/react/dist/server/babel_config.js:28:23)
at exports.default (/Users/alvaropinot/foo/foo-Web/node_modules/@storybook/react/dist/server/config.js:18:48)
at exports.default (/Users/alvaropinot/foo/foo-Web/node_modules/@storybook/react/dist/server/middleware.js:14:37)
at Object. (/Users/alvaropinot/foo/foo-Web/node_modules/@storybook/react/dist/server/index.js:149:34)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
As it can be seen the line 69 of babel_config.js relies on finalConfig.plugins being an array to call the push method.
Either the .babelrc file could be validated or the maybe the error could be controlled showing a more user friendly and intuitive message, or even recover from it creating a plain new array. What do you think?
Adding something like the following could do the trick 😄 :
An incorrect
.babelrc
file such as:where
plugins
is NOT an array will lead to the following errortrace (click to expand)
start-storybook -p 6006 -c .storybook@storybook/react v3.0.0-rc.2
=> Loading custom .babelrc
/Users/alvaropinot/foo/foo-Web/node_modules/@storybook/react/dist/server/babel_config.js:28
finalConfig.plugins.push([require.resolve('babel-plugin-react-docgen'), { DOC_GEN_COLLECTION_NAME: 'STORYBOOK_REACT_CLASSES' }]);
^
TypeError: finalConfig.plugins.push is not a function
at exports.default (/Users/alvaropinot/foo/foo-Web/node_modules/@storybook/react/dist/server/babel_config.js:28:23)
at exports.default (/Users/alvaropinot/foo/foo-Web/node_modules/@storybook/react/dist/server/config.js:18:48)
at exports.default (/Users/alvaropinot/foo/foo-Web/node_modules/@storybook/react/dist/server/middleware.js:14:37)
at Object. (/Users/alvaropinot/foo/foo-Web/node_modules/@storybook/react/dist/server/index.js:149:34)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
npm ERR! Darwin 16.3.0
npm ERR! argv "/Users/alvaropinot/.nvm/versions/node/v7.7.2/bin/node" "/Users/alvaropinot/.nvm/versions/node/v7.7.2/bin/npm" "run" "storybook"
npm ERR! node v7.7.2
npm ERR! npm v4.1.2
npm ERR! code ELIFECYCLE
npm ERR! foo@0.1.0 storybook:
start-storybook -p 6006 -c .storybook
npm ERR! Exit status 1
As it can be seen the line 69 of babel_config.js relies on
finalConfig.plugins
being an array to call thepush
method.Either the
.babelrc
file could be validated or the maybe the error could be controlled showing a more user friendly and intuitive message, or even recover from it creating a plain new array. What do you think?Adding something like the following could do the trick 😄 :
The text was updated successfully, but these errors were encountered: