Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

WebGL failing to build in URP.

Discussion in 'Universal Render Pipeline' started by nicg220, Feb 16, 2022.

  1. nicg220

    nicg220

    Joined:
    Nov 25, 2019
    Posts:
    16
    Hi,

    I'm currently running Unity version 2021.2.4f1 and am using the Universal Rendering Pipeline.

    Since upgrading my project to URP, I have been unable to build to webGL. Initially I get the following error :

    'Shader error in 'Hidden/Universal/CoreBlit': invalid subscript 'positionCS' at Game/Library/PackageCache/com.unity.render-pipelines.core@12.1.1/Runtime/Utilities/Blit.hlsl(92) (on gles)'

    However when attempting to build straight after, I get a whole list of errors within the 'Library/Bee' folder, such as :

    'Library\Bee\artifacts\WebGL\build\debug_WebGL_wasm\build.js: undefined symbol: __Connect (referenced by top-level compiled C/C++ code)'

    I found another forum post that detailed a similar issue, however I could not find any resolution to the problem.

    I'm wondering if anyone has any experience with this issue or who might be aware of a fix? I've tried updating the project to numerous later versions, however this has not solved the issue.

    Thank you!
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,415
    Have you tried updating to the latest 2021.2 and updating your packages to the latest available version?
     
  3. nicg220

    nicg220

    Joined:
    Nov 25, 2019
    Posts:
    16
    Hi DevDunk, Thanks for your response. I've tried updating my project to that latest version, 2021.2.11. This unfortunately didn't seem to resolve the issue. As far as I can tell all my packages are up to date.

    I also tried to downgrade to an earlier version of 2021.2.2, however this didn't help either.

    I also upgraded another project (that was previously working and using version 2020.3.8f1) to 2021.2 and this seems to have caused the same issue as mentioned in my previous posts.
     
  4. eHaka

    eHaka

    Unity Technologies

    Joined:
    Jan 23, 2020
    Posts:
    11
  5. nicg220

    nicg220

    Joined:
    Nov 25, 2019
    Posts:
    16
    Hi eHaka,

    Thanks very much for your response. I've changed the typo but whenever I go back into Unity the shader seems to return back to its original state, changing the line of code that I've amended back to it's original state.
     
  6. nicg220

    nicg220

    Joined:
    Nov 25, 2019
    Posts:
    16
    I've amended the typos now, but unfortunately I still seem to be unable to build, and am getting over forty errors relating to the 'Bee' folder. The first of these errors states :

    Library\Bee\artifacts\WebGL\build\debug_WebGL_wasm\build.js: undefined symbol: __Connect (referenced by top-level compiled C/C++ code)
    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()
     
  7. nicg220

    nicg220

    Joined:
    Nov 25, 2019
    Posts:
    16
    It seems that these issues are being caused by a package within my project that seems to be causing issues when exporting to webgl. I've not found a fix yet but found this forum post to be potentially useful.
     
  8. eHaka

    eHaka

    Unity Technologies

    Joined:
    Jan 23, 2020
    Posts:
    11
    The packages are immutable, you need to override it with a local package to make it mutable. Copy it to Packages/ and/or change manifest.json to point to a local copy.

    Keep in mind that by doing this you are modifying the package source and making it a custom local package. Keeping it up to date and working is up to you.

    Other (and safer) option is to wait for the official package release that has this fix in.
     
  9. nicg220

    nicg220

    Joined:
    Nov 25, 2019
    Posts:
    16
    Thank you eHaka, I've tested that out and the issues relating to the shaders seem to be fixed.
     
  10. themorfeus

    themorfeus

    Joined:
    Jun 14, 2013
    Posts:
    10
    Any updates on this? There has been updates since this issue was noticed, yet they still haven't fixed it in the latest 12.1.6 version.
     
    zyzyx likes this.
  11. BlakCake

    BlakCake

    Joined:
    Nov 25, 2017
    Posts:
    3
    Bump. Unity 2021 just got in to LTS with this error still happening, creating our own package isn't a real solution. I mean, are we expected to just wait for a fix and not be able to create a build until then?
    Is there an ETA for this fix?
     
    Chezus, SauronDark, Jonathis and 2 others like this.
  12. Jonathis

    Jonathis

    Joined:
    Dec 17, 2020
    Posts:
    1
    Experiencing this issue as well. Would be great if known solution makes it into official package release.
     
    SamMcA likes this.
  13. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,009
    Just got this when building for Android
    And I already removed Opengles2 from GraphicsAPI than WHY ?
    Unity 2021.2.19f1

    Why why why, we always got this problems with unity.
     
  14. SauronDark

    SauronDark

    Joined:
    Mar 2, 2017
    Posts:
    16
    for me, it's solved by not using the "build and run" option, just use the "build" button and deploy apk manually.
     
  15. eHaka

    eHaka

    Unity Technologies

    Joined:
    Jan 23, 2020
    Posts:
    11
    Backport of this bugfix appears to have been merged to 21.2 2 days go.
     
    SauronDark likes this.
  16. alvaromagnum

    alvaromagnum

    Joined:
    Dec 3, 2017
    Posts:
    12
    I changed back to built-in render pipeline so I could build my project again. I got the same error when building to webgl, but changing the render pipeline solved.
     
  17. SamMcA

    SamMcA

    Joined:
    Dec 17, 2013
    Posts:
    9
    Is there an ETA on when this fix will be released?
     
  18. eHaka

    eHaka

    Unity Technologies

    Joined:
    Jan 23, 2020
    Posts:
    11
    Should be fixed. Which Unity version are you using?