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

1907 views javascript
2

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"

and

"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

2

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?

JD

Please login first before posting an answer.