Skip to content

'export default from' can not be correctly compiled #7293

@leaves4j

Description

@leaves4j

Choose one: bug

Input Code

var from = 'test';
export default from;

Babel/Babylon Configuration (.babelrc, package.json, cli command)

{
  presets: [
        [
          '@babel/preset-env', {
            targets: { browsers: ['android>=4', 'ios>=7'] },
            modules: false,
          },
        ],
      ],
      plugins: [
        '@babel/plugin-transform-runtime',
      ],
}

Expected Behavior

Compiled correctly

Current Behavior

Throw an error

[!] (babel plugin) SyntaxError: /xxx/node_modules/@babel/runtime/core-js/array/from.js: Support for the experimental syntax 'exportDefaultFrom' isn't currently enabled (6:8):

  4 | var from = require$$0;
  5 |
> 6 | export default from;
    |        ^
  7 | export { from as __moduleExports };

Add @babel/plugin-proposal-export-default-from (https://git.io/vb4yH) to the 'plugins' section of your Babel config to enable transformation.
software version(s)
Babel 7.0.0-beta.38
Babylon
node 9.4
npm
Operating System mac os

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions