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.

Babel throws "Plugin/Preset files are not allowed to export objects, only functions."

See original GitHub issue

lingui 2.0.4, babel 7.0.0-beta.40

> lingui extract --clean

Extracting messages from source files…
/code/App/node_modules/@babel/core/lib/config/config-descriptors.js:158
    throw new Error("Plugin/Preset files are not allowed to export objects, only functions.");
    ^

Error: Plugin/Preset files are not allowed to export objects, only functions.
    at createDescriptor (/code/App/node_modules/@babel/core/lib/config/config-descriptors.js:158:11)
    at /code/App/node_modules/@babel/core/lib/config/config-descriptors.js:101:12
    at Array.map (<anonymous>)
    at createDescriptors (/code/App/node_modules/@babel/core/lib/config/config-descriptors.js:100:27)
    at createPresetDescriptors (/code/App/node_modules/@babel/core/lib/config/config-descriptors.js:92:10)
    at /code/App/node_modules/@babel/core/lib/config/config-descriptors.js:64:19
    at presets (/code/App/node_modules/@babel/core/lib/config/config-descriptors.js:54:25)
    at mergeChainOpts (/code/App/node_modules/@babel/core/lib/config/config-chain.js:294:68)
    at /code/App/node_modules/@babel/core/lib/config/config-chain.js:247:7
    at buildRootChain (/code/App/node_modules/@babel/core/lib/config/config-chain.js:83:20)

There’s a closed issue mentioning something like this: https://github.com/lingui/js-lingui/issues/163

The difference is that I actually updated to 2.0.4 from 2.0.0 and got this error (while the author of issue#163 had an opposite situation - he was getting this on 2.0.2 and it was “fixed” and updated to 2.0.4)

Any ideas how to fix that?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:7
  • Comments:27 (17 by maintainers)

github_iconTop GitHub Comments

5reactions
tricoder42commented, May 15, 2018

@adamgruber Absolutely. I’m planning releasing new version using Babel 6 with new major version using Babel 7 (even in beta). I’m just fixing some Babel-related issues, so once it’s ready, I’m gonna publish it.

5reactions
ipeocommented, Mar 7, 2018

I have the exact same issue

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 ... - GitHub
Module build failed: Error: [BABEL] /Users/kukuchong/yunshipei/dawn/src/index.js: Plugin/Preset files are not allowed to export objects, only functions.
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 >
Getting "Error: Plugin/Preset files are not allowed to export ...
[Solved]-Getting "Error: Plugin/Preset files are not allowed to export objects, only functions." from babel-preset-react-app/index.js-babel.js.
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