React-snap: /./shell.html pageerror: Error: SyntaxError: Unexpected token <

Created on 4 Jan 2018  路  6Comments  路  Source: stereobooster/react-snap

Extracted from https://github.com/stereobooster/react-snap/pull/96

To reproduce use any CRA project, set "homepage": ".", .

Duplicate https://github.com/stereobooster/react-snap/issues/59

bug

Most helpful comment

Also seems to happen if a script's src 404's.

All 6 comments

This error happens when browser requests js (or json?) file and gets html instead. Can be solved by code similar to WebpackDevServerUtils.js. Also can be caused by relative paths, like <script src="bundle.js">

Also seems to happen if a script's src 404's.

I'm getting this as well. Also tried the solution in https://github.com/stereobooster/react-snap/issues/59, but that only worked for the home page and its assets. Any further guidance towards

code similar to WebpackDevServerUtils.js.

?

You have 404 for some of the js scripts. Open page in browser and find it.

Propper bugfix would be to add logging for 404 js documents

Added loging in 1.11.3. Need to rework server to actually fix all edge cases. Want to get some ideas from https://github.com/facebook/create-react-app/blob/19e0bb1881e24fb1ee3fe421413d4d87e67f68dd/packages/react-dev-utils/WebpackDevServerUtils.js

Close in favour of #153

Was this page helpful?
0 / 5 - 0 ratings