Ryan Green
Ryan Green2mo ago

allocateUTF8 is not defined

I've created a webgl build in Unity 2023.2.20f1 and Normcore 2.10.4 and I'm receiving the following error when attempting to connect to a room using a room name entered from a text input in the build.
ReferenceError: allocateUTF8 is not defined
at ClientStartConnection
ReferenceError: allocateUTF8 is not defined
at ClientStartConnection
in the following section of the jslib
function ClientStartConnection(clientPointer) {
var clientOffer = __pendingOffers.get(clientPointer);
if (clientOffer == null) {
clientOffer = "";
__pendingOffers.set(clientPointer, clientOffer);
Instance.Get(clientPointer).startConnection().then(function(co) {
if (__pendingOffers.get(clientPointer) != "")
return;
__pendingOffers.set(clientPointer, co)
})
}
if (clientOffer != "") {
__pendingOffers["delete"](clientPointer)
}
return allocateUTF8(clientOffer)
}
function ClientStartConnection(clientPointer) {
var clientOffer = __pendingOffers.get(clientPointer);
if (clientOffer == null) {
clientOffer = "";
__pendingOffers.set(clientPointer, clientOffer);
Instance.Get(clientPointer).startConnection().then(function(co) {
if (__pendingOffers.get(clientPointer) != "")
return;
__pendingOffers.set(clientPointer, co)
})
}
if (clientOffer != "") {
__pendingOffers["delete"](clientPointer)
}
return allocateUTF8(clientOffer)
}
is my version of Unity supported for gl builds? should I be using a different version of normcore?
4 Replies
kapa.ai
kapa.ai2mo ago
Hi @Ryan Green. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Normcore currently supports all platforms supported by Unity 2020 LTS. However, it's important to note that WebGL support is currently in alpha and may not be fully stable. If you would like access to this feature, you should contact Normcore (https://normcore.io/documentation/platforms/webgl) directly. The error you're encountering seems to be related to the WebGL build and not directly related to Normcore. It might be due to the Unity version you're using (2023.2.20f1) which is not mentioned in the supported platforms (https://normcore.io/documentation/platforms) for Normcore. If you're still encountering issues after checking these points, I recommend reaching out to the Normcore community on their Discord (https://normcore.io/documentation/essentials/common-questions#does-normcore-support-x-y-z) for further assistance. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai2mo ago
<@337874773742845953> kapa.ai is still learning and improving, please let us know how it did by reacting below
maxweisel
maxweisel2mo ago
We’ve only tested up through 2022. allocateUTF8 is a core emscripten function. if it’s missing I expect this is a unity issue
Ryan Green
Ryan Green2mo ago
ah ok, I'll see if there are any unity issues related to this. I was able to get past the error by adding
webGLEmscriptenArgs: -s EXTRA_EXPORTED_RUNTIME_METHODS='["allocateUTF8"]'
webGLEmscriptenArgs: -s EXTRA_EXPORTED_RUNTIME_METHODS='["allocateUTF8"]'
to my ProjectSettings.asset file