You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 19, 2019. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 19, 2019. It is now read-only.
contains also path: 'public' which should be declared later on in the tutorial. Otherwise, it will keep returning the Unexpected token < (bundle.js:1) error.
Correct, the issue persists if webpack.config.js is not amended in a similar way at this first step of booting a prod server: output: { /*path: "public",*/ filename: "bundle.js", publicPath: "/" },
Moving bundle.js from ./public to . will make the error disappear.
One way to move bundle.js is not to put in the "path: 'public'" line until after this step. This also keeps the public directory from being created, which makes the next step of the tutorial break.
The only remaining issue is updating the path in webpack .config.js is now listed twice, so those following the tutorial will still get stuck. Adding a PR.
Activity
timdorr commentedon Aug 23, 2016
Yep, that looks to be a small oversight. Can you submit a PR to fix it?
Missing step- adding path the webpack.js
Missing step- adding path the webpack.js (#224)
spik3s commentedon Sep 26, 2016
Small fix, now that
publicPath: '/'is declared, the snippet of codecontains also
path: 'public'which should be declared later on in the tutorial. Otherwise, it will keep returning the Unexpected token < (bundle.js:1) error.smilingkylan commentedon Oct 27, 2016
Thanks a ton for the heads-up guys.
eurobob commentedon Dec 7, 2016
the
path: 'public'issue that spik3s pointed out is still an issue. Tripped me up at leastdloret commentedon Dec 8, 2016
Correct, the issue persists if webpack.config.js is not amended in a similar way at this first step of booting a prod server:
output: { /*path: "public",*/ filename: "bundle.js", publicPath: "/" },@spik3s: thanks.
merriam commentedon Mar 21, 2017
To add a bit more information:
The error is from Express not finding ./public/bundle.js because it is looking for ./bundle.js. It keeps looping back until it just tries to deal with index.html. See http://stackoverflow.com/questions/38743275/express-js-unexpected-token.
Moving bundle.js from ./public to . will make the error disappear.
One way to move bundle.js is not to put in the "path: 'public'" line until after this step. This also keeps the public directory from being created, which makes the next step of the tutorial break.
The only remaining issue is updating the path in webpack .config.js is now listed twice, so those following the tutorial will still get stuck. Adding a PR.
merriam commentedon Mar 21, 2017
If we apply PR #310, we can close #229, #242, #280, #282, #289, and #291. Everyone runs across this bug.
Missing step- adding path the webpack.js (#224)