I left my app running when I went out and when I came back hours later the app had died with this message:
undefined:1
<!DOCTYPE html>
^
SyntaxError: Unexpected token <
at Object.parse (native)
at IncomingMessage.<anonymous> (/home/engine/private_js/N.app.js:35:296)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:919:16
at process._tickCallback (node.js:419:13)
In app.js there are only 244 lines of code what kind of error is this I've not seen one like this before, google has nothing on it except a paste bin, I am sure it comes from deep in node.js
lol, server burp?
The JavaScript exceptions "unexpected token" occur when a specific language construct was expected, but something else was provided. This might be a simple typo.
Uncaught SyntaxError: Unexpected token < means server already send index. html file to chrome, but server can't find your frontend static path.
To solve the "Uncaught SyntaxError: Unexpected identifier" error, make sure you don't have any misspelled keywords, e.g. Let or Function instead of let and function , and correct any typos related to a missing or an extra comma, colon, parenthesis, quote or bracket.
Without seeing any code, my guess is you're trying to JSON.parse()
a response from a server, but it's returning HTML instead of JSON. You should check the response's content-type
to make sure it is application/json
before trying to parse the response.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With