Multiple Uncaught ReferenceError in Unity WebGL build (6.0.34)

Hello,

I have been testing Unity 6 for a possible version update and came across some errors regarding the WebGL build.

First:
When trying to open system’s window for file uploads in my app, I get the following error:

Uncaught ReferenceError: Pointer_stringify is not defined at _UploadFile

This _UploadFile is a method in the unity.framework.js and indeed contains the Pointer_stringify method:

function _UploadFile(gameObjectNamePtr, methodNamePtr, filterPtr, multiselect) {
            gameObjectName = Pointer_stringify(gameObjectNamePtr);
            methodName = Pointer_stringify(methodNamePtr);
            filter = Pointer_stringify(filterPtr);
            ...

For curiosity, I uncompressed the “.framework.js.unityweb” file generated in the build folder and it does contain this code.
Finally, when this error occurs, the app is halted.

Second:
A similar error whenever I try to edit a text in a TextMeshPro - InputField object. This time the error refers to the allocate:

Uncaught ReferenceError: allocate is not defined at input.oninput

This one does not halt the app.

Are these bugs or am I missing something in, for example, webgl export settings?
Thanks in advance for any help or further instructions. I can also provide more details on those cases.

Hi. Pointer_stringify was deprecated and removed altogether at some point, these calls should be replaced with UTF8ToString. The second one is probably also some deprecated API in TMP.

2 Likes

Adding to Ali’s answer there is this documentation page which lists all the deprecated browser interaction code that needs to be updated when migrating to Unity 6 from an older version: Unity - Manual: Replace deprecated browser interaction code.

Regarding the TextMeshPro issue: can you give use a code snippet that triggers that issue? Or is it something inside the TextMeshPro codebase?

1 Like