an error occurred running the unity content on this page. see your browser javascript console for more info. the error was: uncaught syntaxerror: unexpected tokrn'<'
第一次发布WebGL还是在17年,当时也没遇到这样的问题。谁知道几年后再搞这个就遇到这么一个坑。发布的时候需要自行添加一个配置文件。
如下图:
文件内容:
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".unityweb" mimeType="application/binary" />
<mimeMap fileExtension=".unity3d" mimeType="application/octet-stream"/>
</staticContent>
<urlCompression doDynamicCompression="false"/>
</system.webServer>
</configuration>
加上这个配置文件上面的问题就解决了