Uncaught SyntaxError: Unexpected token '<' while deploying create react app to firebase hosting

Nikita Yakunin

I'm trying to deploy my app to firebase hosting and I'm getting this error in the console Uncaught SyntaxError: Unexpected token '<' in several *.chunk.js files. I have already deployed my app to gh-pages and everything has worked just fine. Also I have tried to deploy it to netlify hosting but I had Failed to load resource: the server responded with a status of 404 () in all *.js files. Here is my firebase.json:

{
  "hosting": {
    "public": "build",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "rewrites": [
      {
        "source": "**",
        "destination": "/index.html"
      }
    ],
    "headers": [
      {"source": "/service-worker.js", "headers": [{"key": "Cache-Control", "value": "no-cache"}]}
    ]
  }
}

For some reason these *.chunk.js files contain some html code image from the console But at the same time my local main.chunk.js does not image of local file

Nikita Yakunin

Apparently, I had a conflict in my package.json file. Necessary for gh-pages "homepage": ... in package.json was somehow messing up with deployments to other hosting providers.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Uncaught SyntaxError: Unexpected token =

Uncaught SyntaxError: Unexpected token :

Create-React-App build - "Uncaught SyntaxError: Unexpected token <"

Uncaught SyntaxError: Unexpected token <

Uncaught SyntaxError: Unexpected token & while rendering a Django template

'Unexpected token import' while testing in create-react-app

"Uncaught SyntaxError: Unexpected token {" while importing

Uncaught SyntaxError: Unexpected token & in javascript django app

Uncaught SyntaxError: Unexpected token < with React

React/Node Uncaught SyntaxError: Unexpected token <

Heroku create-react-app deploy Uncaught SyntaxError: Unexpected token <

create-react-app Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0

Uncaught SyntaxError: Unexpected token ')'

Uncaught SyntaxError: Unexpected token '&'

Uncaught SyntaxError: Unexpected token 'if'

Firebase deployed react app not working. Uncaught SyntaxError: Unexpected token '<'

Uncaught SyntaxError: Unexpected token :

Uncaught SyntaxError: Unexpected token :

Uncaught SyntaxError: Unexpected token <

Uncaught SyntaxError: Unexpected token }

Uncaught SyntaxError: Unexpected token ; after deploying to heroku in application.js

Uncaught SyntaxError: "Unexpected token { "

Uncaught SyntaxError: Unexpected token : while trying to create url path

uncaught syntaxerror; unexpected token <

Uncaught SyntaxError: Unexpected token '<'

Uncaught SyntaxError: Unexpected token '!'

Firebase: Uncaught SyntaxError: Invalid or unexpected token -> uncaught referenceError

Uncaught SyntaxError: Unexpected token '<' (at index.js:1:1) REACT APP

Uncaught SyntaxError: Unexpected token '<'

TOP Ranking

HotTag

Archive