Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web Editor – "Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'msg_send_queue')" #99818

Closed
Meorge opened this issue Nov 29, 2024 · 11 comments

Comments

@Meorge
Copy link
Contributor

Meorge commented Nov 29, 2024

Tested versions

  • Reproducible in 4.4.dev [0eadbdb]

System information

Google Chrome 131.0.6778.86 on macOS Sequoia 15.1.1 with Intel processor

Issue description

Following the instructions for Building the Editor on Compiling for the Web, the Loader screen (where a project ZIP can be selected) appears correct but when I attempt to load the actual editor, it gets stuck on the Godot splash screen.

In the JavaScript console, I see the following error:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'msg_send_queue')
    at Object.sendmsg (godot.editor.js:5034:14)
    at Object.write (godot.editor.js:4640:28)
    at Object.write (godot.editor.js:3478:42)
    at ___syscall_sendto (godot.editor.js:5428:17)
    at godot.web.editor.dev.wasm32.wasm.sendto (godot.web.editor.dev.wasm32.wasm-7f02190a:0x3816d24)
    at godot.web.editor.dev.wasm32.wasm.send (godot.web.editor.dev.wasm32.wasm-7f02190a:0x3816d11)
    at godot.web.editor.dev.wasm32.wasm.__netlink_enumerate (godot.web.editor.dev.wasm32.wasm-7f02190a:0x37e8599)
    at godot.web.editor.dev.wasm32.wasm.__rtnetlink_enumerate (godot.web.editor.dev.wasm32.wasm-7f02190a:0x37e852c)
    at godot.web.editor.dev.wasm32.wasm.getifaddrs (godot.web.editor.dev.wasm32.wasm-7f02190a:0x37e5bfc)
    at godot.web.editor.dev.wasm32.wasm.IPUnix::get_local_interfaces(HashMap<String, IP::Interface_Info, HashMapHasherDefault, HashMapComparatorDefault<String>, DefaultTypedAllocator<HashMapElement<String, IP::Interface_Info>>>*) const (wasm://wasm/godot.web.editor.dev.wasm32.wasm-7f02190a)

Resizing the window causes the Godot splash screen to disappear and be replaced with a pure black screen.

Steps to reproduce

Build the editor for web using

scons platform=web target=editor

Run the web editor:

python platform/web/serve.py

and select godot.web.editor.dev.wasm32/ from the directory listing, then godot.editor.html.

The loader screen should appear correctly. Open the JavaScript console. Click "Start Godot editor".

You should see the usual output from Godot's console on startup...

Godot Engine v4.4.dev.custom_build.0eadbdb5d (2024-11-28 14:08:33 UTC) - https://godotengine.org
OpenGL API OpenGL ES 3.0 (WebGL 2.0 (OpenGL ES 3.0 Chromium)) - Compatibility - Using Device: WebKit - WebKit WebGL

...but after that, the JavaScript error written above.

A full image of the JavaScript console for reference:
Image

Minimal reproduction project (MRP)

N/A

@Meorge
Copy link
Contributor Author

Meorge commented Dec 20, 2024

After rebasing on master, updating Emscripten, clearing my browser cache, and uninstalling the service worker in my browser, I'm not getting this error anymore, but now a different one:

Uncaught (in promise) LinkError: WebAssembly.instantiate(): Import #170 "env" "getaddrinfo": function import requires a callable

Image

However, I'm not sure if this means the previous bug was fixed and now I'm "closer" to having the web editor running, or if this new message is preventing the msg_send_queue one from showing up. As such I don't think it makes sense for this issue to be closed yet, but it might be resolved...?

@akien-mga
Copy link
Member

Which Emscripten version are you using? Official builds use 3.1.64, and there are know issues with 3.1.71+.

@Meorge
Copy link
Contributor Author

Meorge commented Dec 20, 2024

Looks like I'm on 3.1.74 right now; I'll see if I can try switching it to 3.1.64 and get it to run there.

@Meorge
Copy link
Contributor Author

Meorge commented Dec 20, 2024

With 3.1.64 of Emscripten I'm getting a different error:

Unknown option '--enable-bulk-memory-opt'
em++: error: '/Users/malcolmanderson/emsdk/upstream/bin/wasm-opt --strip-target-features --post-emscripten -Os --low-memory-unused --zero-filled-memory --pass-arg=directize-initial-contents-immutable --no-stack-ir bin/godot.web.editor.dev.wasm32.wasm -o bin/godot.web.editor.dev.wasm32.wasm -g --mvp-features --enable-threads --enable-bulk-memory --enable-bulk-memory-opt --enable-call-indirect-overlong --enable-exception-handling --enable-multivalue --enable-mutable-globals --enable-reference-types --enable-sign-ext' failed (returned 1)
scons: *** [bin/godot.web.editor.dev.wasm32.js] Error 1
scons: building terminated because of errors.
[Time elapsed: 00:00:14.77]

@adamscott adamscott self-assigned this Jan 10, 2025
@adamscott adamscott moved this from For team assessment to In progress / Assigned in Platforms Issue Triage Jan 10, 2025
@adamscott adamscott moved this from Unassessed to Very Bad in 4.x Release Blockers Jan 10, 2025
@adamscott
Copy link
Member

Relates to emscripten-core/emscripten#23046.

@clayjohn clayjohn added this to the 4.4 milestone Jan 31, 2025
@akien-mga
Copy link
Member

This doesn't seem to affect the official builds for the editor: https://editor.godotengine.org/releases/4.4.beta2/

They're made with Emscripten 3.1.64 and the command from here: https://github.com/godotengine/godot-build-scripts/blob/main/build-web/build.sh#L49

scons production=yes target=editor use_closure_compiler=yes

Could you check if using the same version and option works around the issue?

@akien-mga
Copy link
Member

I suspect your issues might be caused by the same problem as #100841 (comment) - a mismatch between versions of various components of the Emscripten stack.

@akien-mga
Copy link
Member

Assuming this hypothesis is correct: #100841 (comment)
the problem would be worked around easily by doing a clean build from scratch (scons ... -c and then scons ...).

@adamscott
Copy link
Member

Assuming this hypothesis is correct: #100841 (comment) the problem would be worked around easily by doing a clean build from scratch (scons ... -c and then scons ...).

This is not enough, unfortunately. Yes, you need to run scons ... -c, but afterwards, you need to disable temporarily the cache: scons ... --cache-disable.

@Meorge
Copy link
Contributor Author

Meorge commented Feb 10, 2025

Well, simultaneous good news and bad news on my end... I checked out 0eadbdb and ran

scons platform=web target=editor -c

then

scons platform=web target=editor --cache-disable

with the hope of re-triggering the error since it was on an old commit, but now it's consistently working fine for me. My only guesses here are that I'm either not completely clearing caches somehow, or while trying to fix this problem, I fixed a broken Emscripten installation that was the root cause of everything 😅

If it's also building fine for others, I suppose we can close this issue then?

@adamscott
Copy link
Member

If it's also building fine for others, I suppose we can close this issue then?

Closing as resolved, then. I didn't have this issue for a while now.

@github-project-automation github-project-automation bot moved this from In progress / Assigned to Done in Platforms Issue Triage Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

5 participants