Skip to content
New issue

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

Unexpected '!' in 'bundle-loader #5148

Closed
avishekjana opened this issue May 20, 2017 · 4 comments
Closed

Unexpected '!' in 'bundle-loader #5148

avishekjana opened this issue May 20, 2017 · 4 comments

Comments

@avishekjana
Copy link

I'm getting this error while working on code splitting with React router. As per the guideline when I'm using bundle loader to lazy load a component, I'm getting this error constantly. I've also installed bundle-loader npm package, but no luck. My import statement is given below
import loadSignin from 'bundle-loader?lazy&name=signin!./views/signin';

Version

4.0.0

Test Case

https://codepen.io/ReactJSTraining/pen/jyYjeW

Steps to reproduce

Expected Behavior

Actual Behavior

@timdorr
Copy link
Member

timdorr commented May 20, 2017

This isn't a router issue.

@timdorr timdorr closed this as completed May 20, 2017
@avishekjana
Copy link
Author

Maybe but whatever documentation given here https://reacttraining.com/react-router/web/guides/code-splitting is not making things very clear.

@timdorr
Copy link
Member

timdorr commented May 20, 2017

Are you using Webpack 2? You need to set it up and use it according to their docs: https://github.com/webpack-contrib/bundle-loader#usage

@kpyorala
Copy link

kpyorala commented Jun 8, 2017

React Router documentation proposes to use Create React App for testing the examples (https://reacttraining.com/react-router/web/guides/quick-start) and maintainers of that project propose not to use bundle-loader (facebook/create-react-app#2477). And as syntax given in code-splitting example doesn't work with CRA, maybe it could be mentioned in the documentation.

@remix-run remix-run deleted a comment from wucanqi Jun 9, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants