Uncaught SyntaxError: Unexpected token '<' after running npm run build

Username (e.g. epiz_XXX) or Website URL

(http://tedisproject.infinityfreeapp.com/)

Error Message

Uncaught SyntaxError: Unexpected token ‘<’ (at main.b6bed880.js:1:1)

Other Information

My React webpage works on localhost via Google Chrome, but after I run npm build and publish it to infinityfreeapp and open it via Google Chrome it gives me this error.

Page did open once on Internet Explorer, but after opening page again I recieved error “SCRIPT5009: ‘Symbol’ is undefined main.b6bed880.js (2,130513)”.

I can open page from my Xiaomi (Android) phone using Google Chrome and everything works except communication with Back End (PHP) - it fails to Fetch. Although I can access my Backend API’s.

What should I do to fix this?

Seems ok to me

2 Likes

I deleted all cookies and site data for my page and now it also works for me. Interesting… why this error occurred?

Hi

Your ab...js script is currently being served to me when visiting the page

difference between ab...js and (old) b6...js

on b6....js that you mentioned at the beginning
you have localhost and port 8000
it is possible that this was the reason
because the address touched something it shouldn’t

6 Likes

I am switching API locations when working on localhost and when deploying my web app. Is that wrong?

How can I prevent this from occurring again?

No, that’s perfectly fine for you to develop. However, we cannot help fix an issue that relies on communication with a script running on your own computer, because we don’t have that.

The error itself makes me suspect that the file was just missing in the first place, and the browser was trying to parse your 404 page or HTML content as Javascript.

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.