Can not upload Unity WebGL in ASP.Net with an error of "The error was: SyntaxError: expected expression, got '<"

I built some sample game in Unity in WebGL and it worked well locally. However, when I tried to put it on my ASP.net MVC, it did not work.

I simply created my ASP.NET MVC project and copied my Unity WebGl Build into the project.

My ASP.NET MVC

But when I ran the web project and opened my Unity WebGL Build, I got an error of "An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was: SyntaxError: expected expression, got '<"

Error

If anyone knows how to solve this problem, please kindly help me.

Thank you in advance.

1 answer

  • answered 2017-12-06 18:09 Nattakorn Promwongsa

    Sorry for my unclear question.

    First, I did not write any code. The code in the first picture is from the html file built by Unity

    I navigated further into JavaScript console. I got the following error:

    Error for Console

    SyntaxError: expected expression, got '<'

    TypeError:UnityLoader[r] is not a function in UnityLoader.js

    Note: It works properly locally.

    Thank you.