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

Bug with WS global patching causing netplay black screen #779

Closed
CanyonTurtle opened this issue Dec 1, 2024 · 1 comment
Closed

Bug with WS global patching causing netplay black screen #779

CanyonTurtle opened this issue Dec 1, 2024 · 1 comment

Comments

@CanyonTurtle
Copy link
Contributor

Bug description

Currently, netplay URLs do not load on desktop web and mobile web.

Reproduce

On any computer browser (e.g. chrome), visit a wasm4 game (e.g. https://wasm4.org/play/kittygame) and press enter->copy netplay URL. Now open another tab and paste. Observe a black screen. Open developer console and see the error:

Uncaught (in promise) TypeError: set WebAssembly.Global.value): Can't set the value of an immutable global.
    at Ct.write (wasm4.js:50:9105)
    at RTCDataChannel.<anonymous> (wasm4.js:50:20165)

Fix exploration

Now observe that if you use devtool source overrides (https://stackoverflow.com/a/61377922), comment out the problematic line (wasm4.js line 50), save, and reload, netplay functions as normal.

This appears to be caused by #715 with this specific change. @JerwuQu any ideas for a fix? I could look myself but I don't want to jump in and break global patching, as I don't know how that part of the codebase works just yet.

JerwuQu added a commit to JerwuQu/wasm4 that referenced this issue Dec 3, 2024
JerwuQu added a commit to JerwuQu/wasm4 that referenced this issue Dec 3, 2024
JerwuQu added a commit to JerwuQu/wasm4 that referenced this issue Dec 3, 2024
aduros added a commit that referenced this issue Dec 5, 2024
 web: safely handle immutable globals #779
@JerwuQu
Copy link
Contributor

JerwuQu commented Dec 5, 2024

Seems to be working now! Can this be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants