Search code examples
asp.net-mvcasp.net-coreunity-webgl

running unity webgl file on ASP.net core mvc


I tried making a webgl game. When I "build and run" it, it works perfectly fine but when I import it in ASP.net core mvc, it says:

Unexpected token '<'

what I tried:

  1. removing compression in unity
  2. using other versions of unity

Solution

  • According to this error message:Unexpected token '<'.

    Check whether the imported JS file path is correct.

    If the import path is correct, there may be a problem with the JavaScript method, and then check whether the method uses an undefined function or the like.