I have tried multiple different solutions found online, but I keep running into the same 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)
I have chnaged firebase.json to
{
"hosting": {
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
]
},
"headers": [
{
"source": "**/.*",
"headers": [
{
"key": "Cross-Origin-Embedder-Policy",
"value": "require-corp"
},
{
"key": "Cross-Origin-Opener-Policy",
"value": "same-origin"
},
{
"key": "Cross-Origin-Resource-Policy",
"value": "cross-origin"
}
]
}
]
}
I have added these lines to my index.html:
<script>
var module = new WebAssembly.Module(buffer);
var instance = new WebAssembly.Instance(module, { js: { js: () => {} } }, {});
</script>
<script src="index.js" crossorigin="anonymous"></script>
To be honest I'm pretty lost. All I want is to my my webpage be the godot game from the index.html.
You have a typo in your
firebase.json
. Theheaders
array should be inside thehosting
object.In your case, remove the closing
}
on line 9 should fix it.For reference, this is what my
firebase.json
looks like.Tested with Godot 4.2.1, firebase 13.0.2, and Firefox 120.0.1.
P.S. I did not make any changes to my
index.html
.ref: https://firebase.google.com/docs/hosting/full-config#headers