IE11 and Edge has error: Parsing error: Unexpected token import
luojinghui opened this issue · 4 comments
luojinghui commented
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
luojinghui commented
@threepointone @birkir @timsuchanek @tadeegan @ctrlplusb help me, thanks
birkir commented
Did you add a polyfill.io for browsers?
ctrlplusb commented
What workflow are you using? Babel & Webpack? You need to transpile import statements in order to run the code in the browser.
gurnzbot commented
Can you expand on that answer at all? I'm also having an issue with the `import('./someComponent') statement when server via SSR.