Issues while re-exporting
See original GitHub issuesrc\index.js renames exports
export * from './data.js';
export * as File from './FileComponent';
export { default as Folder } from './FolderComponent';
export { Drive as default } from './DriveComponent';
.babelrc typical esnext ReactJS setup
{
"presets": [
"es2015-loose",
"stage-0",
"react"
],
"plugins": [
["transform-runtime"],
["transform-decorators-legacy"],
["transform-export-extensions"]
]
}
The error:
ERROR in ./src/index.js
Module parse failed: \node_modules\react-hot-loader\index.js!\node_modules\babel-loader\index.js?{"presets":["es2015-loose","stage-0","react"],"plugins":[["transform-runtime"],["transform-decorators-legacy"],["transform-export-extensions"]],"cacheDirectory":"\\.cache\\babel-loader"}!\src\index.js 'import' and 'export' may only appear at the top level (5:0)
You may need an appropriate loader to handle this file type.
SyntaxError: 'import' and 'export' may only appear at the top level (5:0)
- Removing
react-hotfrom loaders list solves the issue but forces refresh which throws away state. - Removing
transform-runtimealso solves the issue, but breaks IE11 due to ES6
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
3 common risks to guard against when exporting
Buy credit insurance to protect against a range of risks including customer bankruptcy or non-payment, contract cancellation, issues with currency conversion or ...
Read more >Challenges when Exporting
Required Documents when Exporting: ... Failure to supply export documents in a timely manner results in delayed shipments and storage. The following export ......
Read more >Top 10 Issues for Small Business Exporters and How to ...
Here 10 issues for small business exporters and links to resources to help overcome them: Is your product export ready?
Read more >Fix export issues in Premiere Pro
Fix common export issues in 7 simple steps · Try exporting your project to a different file format. · Exporting to H. ·...
Read more >Challenges of exporting | nibusinessinfo.co.uk
Understanding what export customers want and how the market operates is vital. · You need to cope with extra logistical problems, contractual issues...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Ah, sorry, RHL 1.x won’t work with Webpack 2 ES modules. Please switch to RHL 3.x beta. https://github.com/gaearon/react-hot-boilerplate/pull/61
Looks like we get more output with
webpack2andes2015-loose-native-modules.