Open HTV04 opened 3 years ago
It's hosted on GitHub pages, but I might try this: https://github.com/gzuidhof/coi-serviceworker if I get a chance
I was able to get past this with the following.
Generate a web application from a LÖVE project in the current directory with the following steps:
npx love.js . web
web
containing many generated files.Create a web server that sets the appropriate HTTP headers to enable use of SharedArrayBuffer
with the following steps:
mkdir server
cd server
touch server.js
Edit server.js
and add the following code:
const express = require('express');
const app = express();
app.use(express.static(
'../web',
{
setHeaders: res => {
res.set('Cross-Origin-Opener-Policy', 'same-origin');
res.set('Cross-Origin-Embedder-Policy', 'require-corp');
}
}
));
const PORT = 1919;
app.listen(PORT, () => console.log('ready'));
Start the web server and run the game with the following steps:
node server.js
While this resolves the SharedArrayBuffer
issue, it hit the new error below.
Uncaught RangeError: offset is out of bounds
at Uint8Array.set (
@mvolkmann
Uncaught RangeError: offset is out of bounds
at Uint8Array.set ()
at processPackageData (game.js:234:26)
Try increasing the memory via the --memory
flag.
It seems that davidobot.net does not return the COOP and COEP response headers shown in the README, which throws this error unless love.js is running in compatibility mode:
Sending the response headers from the README fixes this error on my local server, so applying them to davidobot.net should fix this issue.