WebGL first steps
I tried adding a minimal implemention of norm into a basic prototype webGL build. Initially with Unity 6, later downgrading to 2022.3.51. I'm seeing Uncaught (in promise) TypeError: Module.addRunDependency is not a function. I've turned off compression, rebuilt fresh, ... stuck.
12 Replies
Hi @Jesse. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
I'm sorry, but the knowledge sources do not contain specific information about the error "Uncaught (in promise) TypeError: Module.addRunDependency is not a function" when building a Normcore project for WebGL in Unity 6 or Unity 2022.3.51.
However, the official documentation does mention that Normcore WebGL support is currently in alpha and provides detailed steps for setting up a WebGL build, including the need to use a specific preview package version (3.0.0-webgl-alpha.X) and to start from Unity 2019 LTS or 2020 LTS for best results. There is no mention of Unity 6 or 2022.3.51 in the WebGL setup instructions, so it is possible that the alpha package may not be fully compatible with those Unity versions yet. You may want to try using Unity 2019 LTS or 2020 LTS as recommended in the documentation, and ensure you are using the correct WebGL alpha package version for Normcore.
If you continue to encounter issues, the documentation suggests reaching out directly to the Normcore team for WebGL alpha support, as this feature is still in preview and may require direct assistance for troubleshooting platform-specific errors. You can contact them via the link provided in the documentation for WebGL alpha access and support: Normcore WebGL (alpha)
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
<@915588446813323295> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
You can use WebGL with Normcore public. I’d start with Unity 2022 LTS, make sure you’re on the latest version of Normcore, and make sure you’re on a paid plan if connecting from a build
Also, most browsers have a lot of restrictions on accessing webrtc APIs. Make sure you’re hosting it from a https source and that you’ve properly enabled support for .wasm file content headers
Is Unity 6 not supported?
It is, but Unity 6 hasn’t been the most stable in terms of bug regressions on the Unity side, so I generally recommend folks start with something that’s known to be working
gotcha
@Jesse I'm curious if you were able to resolve this one. I started looking into it today and it seems this error occurs when trying to do file system access in Unity WebGL.
I'm unable to reproduce that stack trace you posted here with Unity 2022 or Unity 6
Do you have a repro project you can share with us?
I did. My original test project was using Unity 6, and there was an issue with the webgl build. Something to do with missing utf8... not sure. I decided to instead use the latest unity LTS build supported by the docs. The project was downgraded to LTS 2022.3.51 (I think). The project ran fine in editor, but showed the issue I provided when I built for WebGL. I then rebuilt the project from scratch in the LTS version and things worked fine.
My first two attempts to get a webgl build working with normcore were broken so I was not sure where the error was. Seemed like norm's fault initially.
Got it, so all is working now?
Yup. All good.
Glad to hear it. Let us know if you need anything else!
Will do. Appreciate the followup.