6

I have been getting the following error constantly throughout this process

SyntaxError: /Users/user1/npmprojects/experiments/test-reactstrap0/src/components/index.js: Support for the experimental syntax 'exportDefaultFrom' isn't currently enabled (15:8):

  13 | export * from './ListItems';
  14 | 
> 15 | export FormField from './FormField';

First I install the plugin: yarn add @babel/plugin-proposal-export-default-from --save-dev

I have also tried installing yarn add babel-preset-stage-1 --save-dev

I have tried adding a .babelrc file with the contents

{
  "plugins": [
    "@babel/plugin-proposal-export-default-from"
  ]
}

I have tried adding the following to my package.json

"babel": {
    "presets": [
    "es2015",
    "stage-1",
    "react"
  ],
  "plugins": [
    "@babel/plugin-proposal-export-default-from"
  ]
}
vsync
  • 118,978
  • 58
  • 307
  • 400
user1753106
  • 1,176
  • 2
  • 10
  • 16

2 Answers2

0

There is an open issue in Babel about it: https://github.com/babel/babel/issues/7293

Looks like you'd additionally need to install @babel/plugin-proposal-export-namespace-from plugin, but not 100% sure, better read through the issue discussion and try the proposed workarounds.

GProst
  • 9,229
  • 3
  • 25
  • 47
0

You can put the configuration in your babelrc.js file:

module.exports = {
  plugins: [
    "@babel/plugin-proposal-export-default-from"
  ]
}

Tools such as babel or babel-loader for Webpack will pick up the configuration from here.

Good Luck...

Aakash
  • 21,375
  • 7
  • 100
  • 81