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

Custom Web Export "Unknown file open mode: wx+" error #45425

Closed
ghost opened this issue Jan 24, 2021 · 10 comments
Closed

Custom Web Export "Unknown file open mode: wx+" error #45425

ghost opened this issue Jan 24, 2021 · 10 comments

Comments

@ghost
Copy link

ghost commented Jan 24, 2021

Godot version:

3.2.3 (I don't know what a commit hash is)

OS/device including version:

Windows 10

Issue description:

I followed this and this tutorial. I disabled a bunch of modules and then compiled Godot 3.2.3. It compiled, but when I put its path in for the debug export for HTML5, the web page gave me the error "Unknown file open mode: wx+".

I don't think the issue is with disabling modules or with my server since I did a compiled a version with nothing disabled and it still didn't work and I also uploaded my project to itch.io and it didn't work on their servers either.

Steps to reproduce:
Honestly, I have no clue how you would reproduce this error because I have no clue if it's my computer or something else.

Minimal reproduction project:

I'm not sure how I would even make a minimal reproduction project.

Edit: I don't think the project is the problem, it's my export template. I made a project with two control nodes and no scripts and it still gave me the same error with the custom templates.

@Calinou
Copy link
Member

Calinou commented Jan 24, 2021

I get a feeling you've used an invalid File write mode which fails silently on some platforms and loudly on others (namely, HTML5).

I'm not sure how I would even make a minimal reproduction project.

You can also upload your entire project here.

@ghost
Copy link
Author

ghost commented Jan 24, 2021

Another thing to note is that my program works fine with the default export templates.
Character Sprite Maker 16x16.zip

@ghost
Copy link
Author

ghost commented Jan 24, 2021

If it's a file write issue, I'm not sure how that would work since I don't actually write to a file in the program. I do use the Image.save_png() function but that is only called when it's not exported to HTML5. Instead, I download the image using this plugin.

@Faless
Copy link
Collaborator

Faless commented Jan 25, 2021

Emscripten broke compatibility removing those flags (breaking our preload script).
The issue is fixed upstream both in 3.2 (#43986) and 4.0 (#43985).
To solve your use do one of the following:

@ghost
Copy link
Author

ghost commented Jan 25, 2021

Not sure what you mean by remove flags. I changed the line to FS.writeFile(path, new Uint8Array(buffer)); and I got a ton of errors in the dev console when I exported to web.

@Faless
Copy link
Collaborator

Faless commented Jan 25, 2021

I changed the line to FS.writeFile(path, new Uint8Array(buffer));

Not sure what errors your are getting, but that's how it's done upstream and it works: https://github.com/godotengine/godot/blob/master/platform/javascript/js/libs/library_godot_os.js#L206

@ghost
Copy link
Author

ghost commented Jan 25, 2021

Maybe I have other errors then. The compile process apparently finished at 51% for some reason and the errors in the dev console are stuff like

**ERROR**: Node not found: HBox/ItemDisplay/ItemPanel/Items.
put_char @ tmp_js_export.js:9
tmp_js_export.js:9    At: scene\main\node.cpp:1381:get_node() - Condition "!node" is true. Returned: 0L
put_char @ tmp_js_export.js:9
tmp_js_export.js:9 **ERROR**: Node not found: HBox/PreviewPanel/MarginContainer/PreviewBox.
put_char @ tmp_js_export.js:9
tmp_js_export.js:9    At: scene\main\node.cpp:1381:get_node() - Condition "!node" is true. Returned: 0L
put_char @ tmp_js_export.js:9
tmp_js_export.js:9 **ERROR**: Node not found: HBox/PreviewPanel/MarginContainer/PreviewBox/Flipped/Switch.
put_char @ tmp_js_export.js:9
tmp_js_export.js:9    At: scene\main\node.cpp:1381:get_node() - Condition "!node" is true. Returned: 0L

@Faless
Copy link
Collaborator

Faless commented Jan 25, 2021

Yep, those seems unrelated project issues

@Faless
Copy link
Collaborator

Faless commented Jan 25, 2021

Yep, those seems unrelated project issues

E.g. you might have disabled some modules or features custom build that you use in your project.

@ghost
Copy link
Author

ghost commented Jan 25, 2021

I see. I went on the custom module website thing and just checked as many things as I could. I probably checked too many then.

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

No branches or pull requests

3 participants