0

I have an angular app where I read Unity WebGl in a iframe. I use the url /assets/webgl/index.html to launch the webgl.

All works in dev, but when I deploy on Firebase, I got this error :

UnityLoader.js:1 Invoking error handler due to Uncaught SyntaxError: Unexpected token < blob:https://MYPROJECT.firebaseapp.com/1002467b-4c14-4974-af91-23aca8b2f4e6:1 Uncaught SyntaxError: Unexpected token <

That's probably firebase rewrite rules because it loads a blob:[my project url]. So I think it is replacing my assets url by the default 'angular' url but I can't find anything related to this.

I've already seen those links but they're old and useless for me :

Anyone faced this issue before ?

I use chrome

LETOURNEUR Léo
  • 283
  • 3
  • 11

2 Answers2

1

By the may, my problem was in the firebase.json :

There was a rewrite rule which makes assets not accessible...

"rewrites": [
   {
      "source": "**",
      "destination": "/index.html"
   }
]

I had to add a rule like this :

{
  "source": "**/assets/webgl/**",
  "destination": "/assets/webgl/index.html**"
}
LETOURNEUR Léo
  • 283
  • 3
  • 11
0

Had to disable compression for the site to workenter image description here

Thomas Hagström
  • 4,371
  • 1
  • 21
  • 27