Davidobot / love.js

LÖVE ported to the web using Emscripten, updated to the latest Emscripten and LÖVE (v11.5)
MIT License
624 stars 28 forks source link

Non-deterministic "An error occurred before the game window could be initialised. Please check the console!" #35

Closed rameshvarun closed 3 years ago

rameshvarun commented 3 years ago

This project is extremely impressive - I think HTML export is the most needed feature in the LOVE ecosystem.

I'm encountering an issue (compatibility mode) where, most of the time my game will load successfully, but every now and then the load fails with the following alert: An error occurred before the game window could be initialised. Please check the console!

The console logs don't have any relevant errors and are the same from a successful load to an unsuccessful load.

Screen Shot 2021-04-13 at 12 45 40 AM

Here's a temporarily hosted version: https://fault-beta.surge.sh/

I also traced this string to Exception.cpp so it looks to be just a generic message.

rameshvarun commented 3 years ago

Looks like https://github.com/Davidobot/love/pull/1 adds the newline that is necessary for emscripten to buffer the line and actually send it to the JS console.

Davidobot commented 3 years ago

Oh! Thanks for the heads up. I didn't realise there was a pull request. I'll merge it and build a new version of love.js today/tomorrow

rameshvarun commented 3 years ago

I've tested out the PR and I can see whats happening now.

I've fixed my code, but the 2x2 canvas issue is still a problem. I will look to see what I can debug here.

Davidobot commented 3 years ago

I think this is related to https://github.com/Davidobot/love.js/issues/16 ?

rameshvarun commented 3 years ago

I'm pretty sure that's it. I'll close this issue.

By the way, I found that builds on emsdk 2.0.17 fail with the following error when run in a webpage.

love.js:9 TypeError: Cannot read property 'buffer' of undefined
    at Object.write (love.js:9)
    at Object.write (love.js:9)
    at Object.writeFile (love.js:9)
    at Object.storeLocalEntry (love.js:9)
    at love.js:9
    at IDBRequest.req.onsuccess (love.js:9)
(anonymous) @ love.js:9

Downgrading to 1.40.1 worked. So the emsdk version should probably be pinned somewhere in the script or in the README.md.

Davidobot commented 3 years ago

I think I build with 2.x.x if I remember correctly. I'll check it out