I\'m trying to write router component for my react app. I\'m create new react class and define some routes in componentDidMount method. This is full method
c
If anyone else is having this problem, please check your devtools network tab for server responses. The reason behind the error message is that you are trying to load a javascript/json file and an html file was returned (possibly an error message).
HTML files start like this normally:
...
The browser sees the first < and gets confused because this is not valid JavaScript so prints out the error message:
SyntaxError: Unexpected token <
So in the above case, when the OP requested a wrong filename, he got an error page back (in HTML) which lead to that error.
Hope that helps someone else :)