AWS SDK gives 'Uncaught SyntaxError: Unexpected token <' in React

1907 views javascript

I keep getting an error in main.js every time I do 'npm run build':

Uncaught SyntaxError: Unexpected token <

It disappears once I refresh the page. I've done some debugging and I found out that there are two libraries which causes that issue:

"aws-sdk": "^2.295.0"


"react-data-export": "^0.4.2"

If one of them is imported to any js file, I get this error. Any ideas how to fix that?

answered question

1 Answer


guess you need to send a cache-control: no-cache; HTTP header, in order to disable the caching, whenever a .js is not found in the static assets and index.html (or some other 404 page) is being returned. then you won't have to refresh the page manually.

posted this

Have an answer?


Please login first before posting an answer.