react-unity-webgl icon indicating copy to clipboard operation
react-unity-webgl copied to clipboard

Uncaught SyntaxError: expected expression, got '<' ----- From using the react-unity-webgl-template

Open dcjweller opened this issue 3 years ago • 1 comments

Please avoid duplicates

Language and Compiler

TypeScript's built-in Compiler

What environment are you using?

Local Development Server

When does your problem occur?

When the Unity Component mounts

What does your problem relate to?

The problem seems React related

React-Unity-WebGL Version

9.0.4

React Version

17.0.33

Unity Version

Unknown

What happened?

I'm aware this is a problem to do with file paths and I have solved this issue with my own unity-react-webgl projects before... however this is occuring with the template so I would have thought it would work without needing to change file paths etc.

The page renders, but there is no Unity scene loading in

I have not changed anything in the folder hierarchy I removed react-unity-webgl and re-added it, as per the instructions

I also get this warning: The script from “http://localhost:3000/public/unitybuild/2021.2/myunityapp.loader.js” was loaded even though its MIME type (“text/html”) is not a valid JavaScript MIME type. react-unity-webgl-tests

Reproducible test case

No response

Would you be interested in contributing a fix?

  • [ ] yes, I would like to contribute a fix

dcjweller avatar Jul 25 '22 18:07 dcjweller

Hi! Thanks for your report, I'll publish a hot fix tomorrow as soon as I'm at my computer!

jeffreylanters avatar Jul 25 '22 18:07 jeffreylanters