ctrlplusb/react-async-component

IE11 and Edge has error: Parsing error: Unexpected token import

luojinghui opened this issue · 4 comments

AsyncLogin.js

import { asyncComponent } from 'react-async-component';

export default asyncComponent({
  resolve: () => import('./index')
});

Use this plug-in for asynchronous loading components, other browsers can run, but in IE10 + all the browsers are reported on this error, do not know why, when the package using the babel compiler. how to solution? thanks

Did you add a polyfill.io for browsers?

What workflow are you using? Babel & Webpack? You need to transpile import statements in order to run the code in the browser.

See babel-plugin-transform-imports

Can you expand on that answer at all? I'm also having an issue with the `import('./someComponent') statement when server via SSR.