Describe the bug
TypeError: Cannot read property 'default' of undefined.
To Reproduce
Steps to reproduce the behavior:
yarn storybook, everything works fineyarn build-storybookโ npx serve .
npx: installed 78 in 2.953s
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ Serving! โ
โ โ
โ - Local: http://localhost:5000 โ

Expected behavior
Work flawlessly the same as yarn storybook.

Screenshots
See above.
Code snippets
Anything is here.
System:
Additional context
I tried to make storybook for React Native Elements and React Native Web.
It was due to wrong webpack.config.js.
// add your custom rules.
{
test: /\.js$/,
include: [
path.resolve(__dirname, '../node_modules/react-native-elements/'),
path.resolve(__dirname, '../node_modules/react-native-ratings/'),
path.resolve(__dirname, '../node_modules/react-native-vector-icons/'),
path.resolve(__dirname, '../'),
],
use: {
loader: 'babel-loader',
options: {
cacheDirectory: false,
presets: ['module:metro-react-native-babel-preset'],
Fixes, this commit:
// add your custom rules.
{
test: /\.js$/,
include: [
path.resolve(__dirname, '../node_modules/react-native/'),
path.resolve(__dirname, '../node_modules/react-native-elements/'),
path.resolve(__dirname, '../node_modules/react-native-ratings/'),
path.resolve(__dirname, '../node_modules/react-native-vector-icons/'),
],
use: {
loader: 'babel-loader',
options: {
cacheDirectory: false,
presets: [
['module:metro-react-native-babel-preset', { 'disableImportExportTransform': true }]
],
build-storybook work flawlessly now. Result: http://rne-storybook.surge.sh
@shilman You can close this issue ๐ค
Most helpful comment
It was due to wrong
webpack.config.js.Fixes, this commit:
build-storybookwork flawlessly now. Result: http://rne-storybook.surge.sh@shilman You can close this issue ๐ค