Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Question .jspre files being ignored(WebGL)

Discussion in '2021.2 Beta' started by Marks4, Sep 25, 2021.

  1. Marks4

    Marks4

    Joined:
    Feb 25, 2018
    Posts:
    547
    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.
     
  2. De-Panther

    De-Panther

    Joined:
    Dec 27, 2009
    Posts:
    589
    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.
     
    tonialatalo likes this.
  3. Marks4

    Marks4

    Joined:
    Feb 25, 2018
    Posts:
    547
    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
     

    Attached Files:

  4. Marks4

    Marks4

    Joined:
    Feb 25, 2018
    Posts:
    547
    @JoshPeterson @LeonhardP

    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!
     
    tonialatalo likes this.
  5. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,981
    @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
     
    Marks4 and tonialatalo like this.
  6. tonialatalo

    tonialatalo

    Joined:
    Apr 23, 2015
    Posts:
    60
    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.
    Code (JavaScript):
    1. web.framework.js:1755 Input Manager initialize...
    2. web.framework.js:1755 UnloadTime: 0.500000 ms
    3. web.framework.js:7 jspre function parsed correctly
    "Initialize engine version: 2021.2.0b11"

    I submitted it as a bug, thanks.
     
    Last edited: Sep 28, 2021
  7. Marks4

    Marks4

    Joined:
    Feb 25, 2018
    Posts:
    547
    @tonialatalo please post the issue link here once it's available.
     
  8. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    1,073
    tonialatalo and De-Panther like this.
  9. Marks4

    Marks4

    Joined:
    Feb 25, 2018
    Posts:
    547
  10. tonialatalo

    tonialatalo

    Joined:
    Apr 23, 2015
    Posts:
    60
    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."
     
    De-Panther likes this.
  11. Marks4

    Marks4

    Joined:
    Feb 25, 2018
    Posts:
    547
  12. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    The fix will be in the upcoming 2021.2.2f1 release.
     
  13. DrViJ

    DrViJ

    Joined:
    Feb 9, 2013
    Posts:
    158
    Last edited: Nov 13, 2021
    tonialatalo likes this.
  14. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    tonialatalo and DrViJ like this.