question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Plugin/Preset files are not allowed to export objects, only functions

See original GitHub issue

Describe 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:

  1. 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:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

8reactions
andyfordcommented, Mar 28, 2019

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)

0reactions
codesinghanoopcommented, Nov 27, 2019

If someone is still facing this issue then please upgrade your babel-core version to latest. npm install babel-core@latest

Read more comments on GitHub >

github_iconTop Results From Across the Web

Preset files are not allowed to export objects - Stack Overflow
js Module build failed: Error: Plugin/Preset files are not allowed to export objects, only functions. Does anyone know how to solve this?
Read more >
Plugin/Preset files are not allowed to export objects, only ...
Hello. I am getting this error. I have seen that there is already about this error. I have tried all but not working...
Read more >
React Native: Plugin/Preset files are not allowed to export ...
React Native: Plugin/Preset files are not allowed to export objects, only functions · You shouldn't be using both expo and react-native presets.
Read more >
Plugin/Preset files are not allowed to export objects, only ...
Hi there! When I running any tests, i getting: Error: Plugin/Preset files are not allowed to export objects, only functions.
Read more >
React Native Notes 6 : Plugin/Preset files are not allowed to ...
Hey,. “React Native Notes 6 : Plugin/Preset files are not allowed to export objects, only functions…” is published by Kuray Ogun in FreakyCoder...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found