Closed Nuku closed 1 year ago
Re-naming the tmp file it creates allows it to be uploaded, but then this error is visible in the console of the resulting page.
I also have this same issue and can attest to @Nuku's fix working. Their following error is due to the environment not having SharedArrayBuffer defined which is required now for 4.0.
Can you reproduce this if you export the project in a path without any spaces or special characters?
If so, please upload a minimal reproduction project to make this easier to troubleshoot.
Re-naming the tmp file it creates allows it to be uploaded, but then this error is visible in the console of the resulting page.
You need to use a web server that sends the correct headers: https://docs.godotengine.org/en/latest/tutorials/export/exporting_for_web.html#threads (Double-clicking an HTML file to run the HTML5 project will not work.)
I experienced this and setting a custom html shell in the export settings will allow it to export.
lacking permissions
error from OP (no need for reproducible project, try any HTML export)But then with the Custom HTML Shell the application does not run:
That's not a bug, see https://github.com/godotengine/godot/issues/65660#issuecomment-1243088017
But then with the Custom HTML Shell the application does not run:
That's not a bug, see #65660 (comment)
You need to use a web server that sends the correct headers
I'm using a web server.
Anyway I'll try from another setup and will update it here.
You need to use a web server that sends the correct headers: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Embedder-Policy#certain_features_depend_on_cross-origin_isolation
And on a secure context.
Yes, I have everything set accordingly already (the correct headers, SSL, etc). I'll try to test on Itch to see how it reacts.
@akien-mga on Itch.io, with both SharedArrayBuffer
support on or off, I got the error:
@alfredbaudisch I got it to work on my webserver by setting the correct cors headers(I used Node.js):
return res.sendFile(path.join(__dirname + '/public' + '/Web8' + req.url)), res.setHeader("Cross-Origin-Opener-Policy", "same-origin"), res.setHeader("Cross-Origin-Embedder-Policy", "require-corp") ;
I guess mostly work, animated textures all come out pink, but that's a different issue for a different thread
@akien-mga on Itch.io, with both
SharedArrayBuffer
support on or off, I got the error:
Itch.io's support for this feature currently only works in Chrome, and I think that looks like Firefox.
Using chrome, but not on Itch.io https://flexiblesurvival.com/resources/FI/play.html
On Thu, Sep 15, 2022 at 3:36 PM Justin @.***> wrote:
@akien-mga https://github.com/akien-mga on Itch.io, with both SharedArrayBuffer support on or off, I got the error:
Itch.io's support for this feature currently only works in Chrome, and I think that looks like Firefox.
— Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/65660#issuecomment-1248708221, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGYPSJHZ45WS4F5PIN4RSLV6OQF5ANCNFSM6AAAAAAQJ26DQI . You are receiving this because you were mentioned.Message ID: @.***>
@nisovin @Thisisntmatt @Nuku I confirm that on Chrome it works both in my local server and Itch.
Created PR https://github.com/godotengine/godot/pull/65881 for fixing the locked file issue. The output file was opened for read and then for write. The instance opened for write is closed before the one opened for read. This causes the _close() on the instance opened for write to fail.
Got it working for myself, but bumped into few issues on the way. Here are my tips for those who want to run it with current alpha:
.tmp
or other files won't work. add_header Cross-Origin-Opener-Policy same-origin;
add_header Cross-Origin-Embedder-Policy require-corp;
SharedArray
error .here is sample, so you can test your browsers: https://www.deins.lv/godot_test/
Did that, new fancy error.
@Nuku That's the original posted error, caused by the failed rename.
I got that error only when trying to use .tmp
http shell. Did you do clean build with:
I experienced this and setting a custom html shell in the export settings will allow it to export.
What do you set the custom shell to?
Can confirm that on alpha17 export to web generates the same
lacking permissions
error from OP (no need for reproducible project, try any HTML export)
- Using "Custom HTML Shell" with https://github.com/godotengine/godot/blob/master/misc/dist/html/full-size.html then the export works But then with the Custom HTML Shell the application does not run:
I see things need to be documented better...
here is sample, so you can test your browsers: https://www.deins.lv/godot_test/
on macos, running in:
Might be related to this issue, but this is from a web export for a web game I'm developing (using Google Firebase as a backend)
I've used the custom shell described above and I'm on Godot 4 beta 2.
Might be related to this issue, but this is from a web export for a web game I'm developing (using Google Firebase as a backend)
I've used the custom shell described above and I'm on Godot 4 beta 2.
This is not a bug. You need to host the project files on a web host that sends the correct headers as described in the Exporting for the Web documentation.
Might be related to this issue, but this is from a web export for a web game I'm developing (using Google Firebase as a backend)
I've used the custom shell described above and I'm on Godot 4 beta 2.
This is not a bug. You need to host the project files on a web host that sends the correct headers as described in the Exporting for the Web documentation.
Ah I see, my mistake! I forgot to add the headers to my firebase.json file. I'll post what I have for posterity's sake in case anyone has the same problem as I did:
"hosting": {
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"headers": [ {
"source" : "**",
"headers" : [
{
"key" : "Access-Control-Allow-Origin",
"value" : "*"
},
{
"key" : "Cross-Origin-Opener-Policy",
"value" : "same-origin"
},
{
"key" : "Cross-Origin-Embedder-Policy",
"value" : "require-corp"
}
]
}],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
Deploying to Firebase hosting using that as my firebase.json file fixed it.
What should you put in the custom section?
On Wed, Sep 14, 2022, 3:50 PM Thisisntmatt @.***> wrote:
I experienced this and setting a custom html shell in the export settings will allow it to export. [image: image] https://user-images.githubusercontent.com/87195335/190276557-38d47412-8cf7-42e8-89f9-664a8864cfbb.png
— Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/65660#issuecomment-1247379192, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGYPSOX6DTE4T7VF55KI6LV6JJFHANCNFSM6AAAAAAQJ26DQI . You are receiving this because you were mentioned.Message ID: @.***>
If anyone is wondering how to do this on apache24 server.
LoadModule headers_module modules/mod_headers.so
in your httpd.conf file<IfModule mod_headers.c>
<Directory />
Header always set Cross-Origin-Opener-Policy "same-origin"
Header always set Cross-Origin-Embedder-Policy "require-corp"
</Directory>
</IfModule>
For .htaccess, you can use this:
<IfModule mod_headers.c>
Header always set Cross-Origin-Opener-Policy "same-origin"
Header always set Cross-Origin-Embedder-Policy "require-corp"
</IfModule>
As a long-time developer I think this path of Godot 4 for the web is problemmatic. I realize it's the browsers coming up with all these security policies but projects generally can be set up to run with no webserver modification provided that all the content is self-contained.
It seems Godot will end up having to create a docker container and be deployed basically with integrated webserver. In other words, I think rather than trying to convince people to add headers to webservers, people expecting an index.html file to 'just work' probably want:
Now, once they have it running, they may investigate and find oh, i can do this myself with just a couple headers. But the problem is that when you're working in godot and just click export to web, you expect it to basically just work since it's for web and you have a browser.
At least, this message is not nearly as helpful as those familiar with the problem imagine: Error The following features required to run Godot projects on the Web are missing: Cross Origin Isolation - Check web server configuration (send correct headers) SharedArrayBuffer - Check web server configuration (send correct headers)
most people who know some web development don't really know about shared array buffers and obscure Spectre mitigation headers.
So you would at least have to give a user friendly message saying like:
Godot 4 uses advanced browser features which are only available if your server sends the following headers on the response for the HTML file:
Cross-Origin-Opener-Policy "same-origin"
Cross-Origin-Embedder-Policy "require-corp"
To set up a preconfigured webserver to run godot 4 projects in the browser, click here. For deployment to a webserver however, you will need to make sure the two headers are sent back when this html file is requested.
I can' guarantee you that 99% of people exporting to web, even literal game developers would not just know what to do from the current message. They would end up frustrated and digging through docs and forums, when they expected it to just run in the browser, like a normal self-contained html5 app.
Having godot 4 apps showing up all over the web is going to be huge. so it seems worthy of streamlining.
and by the way, one application of godot 4 is in education. at my company I made this application: https://designer.knowledgecity.com (desktop only) and one thing I would like to do is include godot based templates for some of the educational activities.
But my post really is not about 'commercial' of pro scenarios when you can take the time to understand the headers etc. It's more about the indie experience where it is very disappointing that you export to web but it doesn't work do to special server settings which HTML/js front end developers almost never deal with.
This is off-topic for the issue originally reported here.
As a long-time developer I think this path of Godot 4 for the web is problemmatic. I realize it's the browsers coming up with all these security policies but projects generally can be set up to run with no webserver modification provided that all the content is self-contained.
This can be worked around without any specific web server configuration. See https://github.com/godotengine/godot-proposals/issues/6616.
Thanks. I added it here because here was where I found the 'solution' so i wasn't aware of anywhere else it was being worked on. at time i didn't realize it was closed, so i was just about to delete it and post as separate issue.
In any case, I'm glad you responded with the link to the correct place to discuss since I have a feeling some people will pass through this way until the workaround becomes automatic.
Godot version
4.0 alpha 16
System information
Windows 11
Issue description
Steps to reproduce
Export, add, Web, export project.
Minimal reproduction project
No response