We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In files using ES2015 Loader spec (e.g. bundle splitting with webpack@2.2.0-rc.3), import(...) throws with SyntaxError: Unexpected token.
import(...)
SyntaxError: Unexpected token
This is true whether using the flow parser or babylon
Sample code:
import React from 'react' import idbKeyval from 'idb-keyval' import Shell from './components/app-shell' class AppShell extends React.Component { constructor () { super() this.state = {app: <Shell />} } componentWillMount () { Promise.all([ idbKeyval.get('store'), import('./root') ]) .then( ([data, module]) => { this.setState({app: <module.default initialData={data} /> })}, (err) => {console.log(err)} ) .catch((err) => { console.log('Chunk loading failed', err) }) } render () { return this.state.app } } export default AppShell
The text was updated successfully, but these errors were encountered:
this is because the babylon plugin dynamicImport isn't used (also on a fork of babylon atm since we haven't released)
dynamicImport
I was about to do this but its a good beginner-friendly issue.
beginner-friendly
classConstructorCall
Sorry, something went wrong.
@hzoo Just saw that myself... happy to close if it's a known quantity.
Can close via #51
Closing per this recommendation
No branches or pull requests
In files using ES2015 Loader spec (e.g. bundle splitting with webpack@2.2.0-rc.3),
import(...)
throws withSyntaxError: Unexpected token
.This is true whether using the flow parser or babylon
Sample code:
The text was updated successfully, but these errors were encountered: