Search Issue Tracker

Won't Fix

Votes

0

Found in

2021.2.2f1

2021.2.6f1

2022.1

2022.2

Issue ID

1401455

Regression

Yes

A jspre syntax error is thrown when running build on WebGL

Web Platform

-

Reproduction steps:
1. Open the user's attached project
2. Build the WebGL player
3. Configure the Apache server and update httpd.conf file according to this documentation: https://docs.unity3d.com/Manual/webgl-server-configuration-code-samples.html
4. Start Apache server
5. Copy the WebGL player build folder to a location depending on your system:
Mac: Library/WebServer/Documents
Windows: htdocs on XAMPP
6. Open the browser and go to the location http://localhost/[build folder name]

Expected result: Build is successfully loaded and no errors are thrown
Actual result: There is an error message about parsing files and the developer console shows a syntax error

Reproducible with: 2021.2.2f1, 2021.2.14f1, 2022.1.0b10, 2022.2.0a7
Not reproducible with: 2020.3.30f1, 2021.2.1f1
Could not test with: 2019.4.36f1 (Error while building: "Failed process stderr log: JS optimizer error")

  1. Resolution Note (2022.2.X):

    Emscripten compiler toolchain doesn't handle minified jspre files. If you need to webpack JS to make the jspre, don't optimize in the webpack step, instead a non-development Unity build will minify the generated framework.js as a whole.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.