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.

Getting missing `exportDefaultFrom` plugin error with `babel` parser, even though it's in `.babelrc`

See original GitHub issue

Similar to #256 , in that I’m using Babel parser (not Babylon, because that doesn’t actually result in all the modifications I’m expecting to see).

Using both local npx jscodeshift and global install.

The Transform is getting interpreted fine, it’s just the Parser is having trouble with my sources (so #245 is not relevant)…

I just get this:

ERR src/components/WipeContainer/index.js Transformation error (This experimental syntax requires enabling the parser plugin: 'exportDefaultFrom' (1:7))
SyntaxError: This experimental syntax requires enabling the parser plugin: 'exportDefaultFrom' (1:7)
   at Object.raise (~/.config/yarn/global/node_modules/@babel/parser/lib/index.js:3834:17)
   at Object.expectPlugin (~/.config/yarn/global/node_modules/@babel/parser/lib/index.js:5147:18)
   at Object.parseExport (~/.config/yarn/global/node_modules/@babel/parser/lib/index.js:8209:12)

I’ve tried different --parser-config jscodeshift.config.json contents (as JSON, as module.exports, using "plugins": ["exportDefaultFrom"] vs the normal .babelrc format, etc), but the CLI help mentions that this is only for Flow or Babylon.

Here’s my .babelrc (which I’d expect gets picked up by jscodeshift since I can’t seem to supply a config any other way?):

{
  "presets": [
    "env",
    "react"
  ],
  "plugins": [
    "transform-object-rest-spread",
    "transform-export-default"
  ]
}

Babel transpilation works fine. It just seems that jscodeshift isn’t picking up on my config?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:3
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
milesjcommented, Apr 9, 2019

Is there a fix for this? This is quite blocking.

0reactions
ElonVolocommented, May 6, 2022

If @fkling is recommending removing babel, should we be going in this direction?

Read more comments on GitHub >

github_iconTop Results From Across the Web

babel/parser
errorRecovery: By default, Babel always throws an error when it finds some invalid code. When this option is set to true , it...
Read more >
@babel/plugin-syntax-export-default-from - Package Manager
Intro. Babel is a tool that helps you write code in the latest version of JavaScript. When your supported environments don't support certain...
Read more >
syntaxerror: this experimental syntax requires enabling one of ...
Install dependencies needed to enable babel to properly parse jsx ... Write simple plugin as described in doc, but get the error. Input...
Read more >
Babel - Storybook
Babel. Storybook's webpack config by default sets up Babel for ES6 transpiling. It has three different modes: CRA - the mode for Create...
Read more >
Babel compile Typescript exportDefaultFrom error
so I npm i @babel/plugin-proposal-export-default-from and here is my .babelrc: { "presets": [ "@babel/env", "@babel/typescript" ] ...
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