Plugin/Preset files are not allowed to export objects, only functions
See original GitHub issueDescribe the bug I’m trying to run the storybook together with expo. But when I try to start storybook on web I get this error:
ERROR in ./storybook/addons.js Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Plugin/Preset files are not allowed to export objects, only functions. In /Users/kristoffernielsen/repos/app/storybook/node_modules/babel-preset-react/lib/index.js
To Reproduce Steps to reproduce the behavior:
- yarn storybook
Expected behavior Storybook will start.
System:
- OS: MacOS
- Framework: [react
- Addons: addon-actions, addon-links, addon-knobs - but it fails even though I remove them from addons.js
package.json “dependencies”: { “expo”: “^32.0.0”, “react”: “16.5.0”, “react-native”: “https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz” }, “devDependencies”: { “@storybook/addon-actions”: “^4.1.6”, “@storybook/addon-knobs”: “^4.1.6”, “@storybook/addon-links”: “^4.1.6”, “@storybook/addon-ondevice-knobs”: “^4.1.6”, “@storybook/addon-ondevice-notes”: “^4.1.6”, “@storybook/addons”: “^4.1.6”, “@storybook/react-native”: “^4.1.6”, “babel-core”: “^6.26.3”, “babel-preset-expo”: “^5.0.0”, “babel-runtime”: “^6.26.0”, “prop-types”: “^15.6.2”, “react-dom”: “16.5.0” },
babel.config.js module.exports = function(api) { api.cache(true); return { presets: [‘babel-preset-expo’], }; };
Additional context Add any other context about the problem here.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:10 (4 by maintainers)
I ran into this problem when we bumped babel-loader from 7.1.5 up to 8.0.5. Rolling babel-loader back to 7.1.5 worked in our situation. (your mileage may vary)
If someone is still facing this issue then please upgrade your babel-core version to latest.
npm install babel-core@latest