Anyone else having this problem? The contents from the .jspre files are not making it into the build, it’s as if they don’t exist. Everything worked fine until 2021.1.
Also got this issue.
It doesn’t matter if the “.jspre” is in a package under “Plugins/WebGL” or in the assets folder under “Plugins/WebGL”.
I see that the “Editor/Data/PlaybackEngines/WebGLSupport/BuildTools/UserJsprePlaceholder.js” is still exists, and that the emcc command still refer to it with the “–pre-js” option.
So it’s just that the “USER_JSPRE_PLACEHOLDER” variable gets null.
Here is a sample project to check the issue. I tried to submit a bug report but the bug report window froze lol. Can someone kindly report this, yes?
On Unity 2021.1 and lower, you get the message on the console: “jspre function parsed correctly”
On Unity 2021.2 you get the undefined error
Please, I’d like to know if you guys are aware of this bug. I tried to report the bug twice, but I can’t because the bug report window freezes. This bug is critical for webgl, most(if not all) of my assets use .jspre files and if this bug doesn’t get fixed before release all of my plugins will suddenly break!
@JoshPeterson @LeonhardP I would also like to know about this, this really badly affects a lot of WebGL plugins (almost all)
I do not know of many users not using plugins within WebGL, we certainly are using a great many. I expect this affects many users of WebGL
UPDATE: I got the error in release build also. Worked in dev, I figure it packages those differently? That’s the output in a dev build, got error popup in rel.
web.framework.js:1755 Input Manager initialize...
web.framework.js:1755 UnloadTime: 0.500000 ms
web.framework.js:7 jspre function parsed correctly
“Initialize engine version: 2021.2.0b11”
I submitted it as a bug, thanks.
@tonialatalo please post the issue link here once it’s available.
We can reproduce this internally and will fix this. Thanks for submitting the bug! It will be available at Unity Issue Tracker - .jspre files being ignored in release build after emscripten update in a bit for people to follow.
@Schubkraft Thanks!
Cool is already fixed internally and coming out in next betas, Jukka gave the info:
"It looks like the regression was caused by an updated JavaScript code minifier in Emscripten 1.38.13 → 2.0.19 transition. The minifier would too aggressively optimize out the scaffolding code that is used to bind the .jspre files to the final output JavaScript, causing the .jspre files to go missing in Release builds that are run through the minifier.
We do have a fix now, soon in the Unity 2021.2 branch. Unfortunately the issue does not have a workaround that could be locally applied, but keep a look out for an updated Unity beta release."
@Schubkraft Did this fix already land?
The fix will be in the upcoming 2021.2.2f1 release.
Hi! Don’t you know if this is the same problem or something similar as in my post?
Hi @DrViJ ,
That looks like a different issue. Thanks for submitting a bug report, we’ll look into it.