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

HTML5 export doesn't work in 4.3 on MacOS on some projects #88964

Closed
ZenRepublic opened this issue Feb 28, 2024 · 20 comments
Closed

HTML5 export doesn't work in 4.3 on MacOS on some projects #88964

ZenRepublic opened this issue Feb 28, 2024 · 20 comments

Comments

@ZenRepublic
Copy link

Tested versions

Reproducible in 4.3 dev 3
not reproducible in: 4.2

System information

Windows 11 Godot 4.3 Dev 3

Issue description

People said my web game loads a long time on macs, and thats exactly the issue 4.3 dev 3 said to have fixed with multithreading.

Well, even an empty scene doesn't work, throwing these errors in browser console

image_2024-02-28_175226611

Steps to reproduce

Just create a project on godot 4.3 dev 3, import html export packages and go to "remote debug" mode.

Minimal reproduction project (MRP)

N/A

@Mickeon
Copy link
Contributor

Mickeon commented Feb 29, 2024

No way #85939 didn't work, right?

@akien-mga
Copy link
Member

It might be the same issue as #88249 which should be fixed in 4.3 dev 4.

@ducpt-bili

This comment was marked as off-topic.

@akien-mga
Copy link
Member

looking for this web deploy on ios work +1 follow issue

Please add such reactions to the OP with the 👍 emoji, not with a comment unless you have more information to add about the bug.

This should be fixed in 4.3 dev 4 which was released yesterday, please test and confirm.

@sweti-yeti
Copy link

sweti-yeti commented Mar 7, 2024

This should be fixed in 4.3 dev 4 which was released yesterday, please test and confirm.

This is still broken in 4.3 dev 4 @akien-mga, tested in a newly created project and ran in browser on Chrome. I get a different error though

Uncaught (in promise) LinkError: WebAssembly.instantiate(): Import #335 module="env" function="invoke_vii": function import requires a callable
    at tmp_js_export.js:52434:17

@akien-mga akien-mga added this to the 4.3 milestone Mar 8, 2024
@akien-mga akien-mga moved this from Unassessed to Immediate Blocker in 4.x Release Blockers Mar 8, 2024
@adamscott
Copy link
Member

Tested this project and I got no errors at all. I used Godot 4.3.dev3 with the supplied export templates.
test-html-export-4.3.dev.zip

@ZenRepublic @sweti-yeti Could you test with my MRP?

@sweti-yeti
Copy link

Tested this project and I got no errors at all. I used Godot 4.3.dev3 with the supplied export templates.
test-html-export-4.3.dev.zip

Okay, this works for me in dev3 and dev4 @adamscott , as does my original MRP after going back and retesting.

The error I reported in my previous comment is a different behavior from OP. In Brave, the first load of the game throws the LinkError and the game gets stuck loading. After a force-refresh the error is no longer present and the project loads fine. The error does not occur on Chrome or Firefox.

However, I just tested with a game I've been working on with 4.2, and when exporting that with 4.3-dev4 I do reproduce the errors in the screenshot of this Issue. I'll see if I can get an MRP together that reproduces.

@ZenRepublic
Copy link
Author

Empty project web build seems to work, tested on dev5 snapshot

@akien-mga akien-mga moved this from Immediate Blocker to Release Blocker in 4.x Release Blockers Apr 25, 2024
@iryan2
Copy link

iryan2 commented May 13, 2024

Are y'all on Windows? I'm getting the same errors as OP with an empty project in 4.3-dev6 on macOS.

@akien-mga
Copy link
Member

So far I could not reproduce this on Linux at all, Web exports work just fine for me.

So yes, I'll assume this is a macOS-specific issue.

Could affected users who can still reproduce this in 4.3-dev6 comment with details on tested OS and browser versions?

@akien-mga akien-mga moved this from Release Blocker to Very Bad in 4.x Release Blockers May 17, 2024
@iryan2
Copy link

iryan2 commented May 21, 2024

macOS Sonoma 14.4.1,
Microsoft Edge Version 125.0.2535.51 (Official build) (arm64)

I get similar errors in Safari Version 17.4.1 (19618.1.15.11.14):
image

@sweti-yeti
Copy link

@akien-mga I still reproduce this error on dev6 with my project migrated from 4.2.1.

My specs:
Ubuntu 23.10
tested on Firefox 126, Brave 1.65.133, and Chrome 125

see screenshot for errors/stacktrace.

I have so far been unsuccessful in building an example project from scratch that reproduces the error, or in stripping down a copy of my main project to create a minimum reproducible example. If you'd like I could share a copy of my project with you privately to help you reproduce the issue, but would prefer not to post my whole project publicly.
image

@dsnopek
Copy link
Contributor

dsnopek commented Jun 27, 2024

This could be related to updating the version of Emscripten used for official Godot releases? If it started in 4.3-dev3, I think that's the version where we switched from using Emscripten 3.1.39 to Emscripten 3.1.53.

@clayjohn clayjohn changed the title HTML5 export just doesn't work in 4.3 dev3 HTML5 export doesn't work in 4.3 on MacOS on some projects Jun 27, 2024
@akien-mga akien-mga moved this from Very Bad to Bad in 4.x Release Blockers Jun 28, 2024
@adamscott
Copy link
Member

@sweti-yeti Do you use GDExtension? Which export template settings do you use? Is it a threaded/non-threaded build? Does it use dlink or not?

@adamscott
Copy link
Member

adamscott commented Jun 29, 2024

macOS Sonoma 14.4.1, Microsoft Edge Version 125.0.2535.51 (Official build) (arm64)

I get similar errors in Safari Version 17.4.1 (19618.1.15.11.14): image

@iryan2 Can you test on a new/empty project and on a more recent beta version of Godot 4.3?

@iryan2
Copy link

iryan2 commented Jun 30, 2024

@adamscott I am pleased to report I not only got a empty project to work with 4.3-beta2, but also the (fairly simple) game that I've been working on! Huge thank you to you and anyone else involved in addressing this issue!!

Just in case anyone else tries the same and finds that it doesn't work out of the box, please note that if I naively open the html file in a browser I get CORS errors like "Failed to fetch". The workaround is to serve the correct headers, in my case I used an npm package called local-web-server like so:

npx local-web-server \ 
  --https \
  --cors.embedder-policy "require-corp"\
  --cors.opener-policy "same-origin" \
  --directory export

... where export is the directory I've exported my project to. You'll also need to install the web export templates, but the godot export UI does a good job of explaining that.

@adamscott
Copy link
Member

@iryan2 You can also just use the Remote Debug feature from the Godot Editor itself! No need to setup a custom server to debug your code.

Capture d’écran, le 2024-06-30 à 12 41 46

@iryan2
Copy link

iryan2 commented Jun 30, 2024

@iryan2 You can also just use the Remote Debug feature from the Godot Editor itself! No need to setup a custom server to debug your code.

Oh wow I had no idea about that, thanks for the tip!

@sweti-yeti
Copy link

@adamscott I have thread support enabled as my game is somewhat physics intensive, so I have the physics running on a separate thread. GDExtension support was enabled but I'm not using it. Not sure about the other settings.

After disabling extension support in the export template the game loads without the errors from before! This is on latest 4.3 beta 2, I can try on dev2 as well based on @dsnopek comment about the emscripten update to see if that's related.

@adamscott
Copy link
Member

Closing the issue as this issue seems too broad to really help. @ZenRepublic, if your problem persist, feel free to tell me in this thread, I'll reopen.

@adamscott adamscott closed this as not planned Won't fix, can't repro, duplicate, stale Jul 2, 2024
@AThousandShips AThousandShips removed this from the 4.3 milestone Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Bad
Development

No branches or pull requests

9 participants