Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Question Errors in WebGL build, into webbrowser

Discussion in 'Web' started by sylvain, Sep 10, 2023.

  1. sylvain

    sylvain

    Joined:
    Feb 19, 2013
    Posts:
    46
    Hi,

    I have a WebGL project working well in Editor, in Play mode, but generates dozen of errors per second in javascript console, in a web browser (same errors in Firefox or Chrome). Probably one error per frame.

    The error is in tjhe Javascript console is :
    Code (CSharp):
    1. ScenarioMapEditor-WEBGL.framework.js.gz:10 ArgumentNullException: Value cannot be null.
    2. Parameter name: shader
    I suspect there is a call to a supposed shader, which is NULL, but not sure. My C# code does not manipulate shaders.

    I built with "Development Build" ON, but not helpful.

    I was able to use profiler but was not able to find where the error is triggered...

    Any idea will be greatly appreciated !!!


    Capture d’écran 2023-09-10 à 11.18.11.png Capture d’écran 2023-09-10 à 11.18.11.png
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    7,263
    To the left of "ArgumentNullException" there is a triangle button. Does this reveal more info?
    If this prints out a callstack but without debugging info (method name, line number) try building with full exception support enabled - you can change this somewhere in Player Settings for the WebGL platform.

    I can imagine you may be using a shader (through a material which may come from a 3rd party asset) that isn't compatible with WebGL. But that is just a guess.
     
  3. sylvain

    sylvain

    Joined:
    Feb 19, 2013
    Posts:
    46
    Thanks for your quick reply.
    I open the triangle and I get the screenshot. Not very clear for me.
     

    Attached Files:

  4. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    7,263
    The exception handling was set to "full" in this case?

    If not try again with this setting:
    upload_2023-9-10_14-17-31.png