Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

Can't transform 'from' correctly #310

Closed
leaves4j opened this issue Apr 15, 2018 · 0 comments · Fixed by #320
Closed

Can't transform 'from' correctly #310

leaves4j opened this issue Apr 15, 2018 · 0 comments · Fixed by #320

Comments

@leaves4j
Copy link

When I use @babel/plugin-transform-runtime and @babel/runtime, Array.from cannot parse correctly:

[!] (babel plugin) SyntaxError: /Users/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.

The array/from.js will transform to export default from.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant