Davidobot / love.js

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

"An error occurred before the game window could be initialised. Please check the console!" #20

Closed thewreck closed 3 years ago

thewreck commented 3 years ago

Trying out the latest node.js with an empty/tiny/big/any löve2d project, I get this error: "An error occurred before the game window could be initialised. Please check the console!" , as soon as the preparing phase is done.

I have tried building the projects with every commit with changes to the wasm in this repo from:

Revision: 5a5f5f3b734affc6553d89e168d7095febabdd83
Date: 10/26/2020 2:28:18 PM
Focus window on loading and on clicking

to

Revision: a4eb3ee735ef70bbbee2964e361aee450a72c491
Date: 7/4/2017 7:29:57 PM
0.11.0-rc3

and all of them fail to load the game - however this specific error stopped after around 10 commits back from HEAD - at which point the "preparing game box" just disappears instead without errors and the page is just the theme, no canvas, no game.

I tried packaging the love.js /spec/ project, and it fails in the same way. Tried on Chrome, Edge and Firefox on Windows 10

The example projects linked (Specification Test, Another Kind of World and groverburger's 3D engine) in the readme all work fine for me, except that the Specification Test sometimes randomly fails to load - hitting F5 has about a 50% success rate. They work both in standard and compatibility mode.

Have tried running it by both: node index.js and love-js and there does not seem to be any errors or issues building.

node version: v14.15.1
npm version: 6.14.8

Any idea what this could be? It feels like I'm missing something obvious.

Davidobot commented 3 years ago

Hm, what does the console print out? If you can, upload a love file for me to try out.

thewreck commented 3 years ago

After much testing - I think we found the problem:

We first tried 7zip to make the zip (using the regular .zip option) and tested that it worked standalone, and tried building with that - and it did not work. Then we went on to try using regular folders, and it also did not work, so we thought that it did not matter.

Now we tried in a desperate final attempt, to use regular windows send to -> compress (zipped) folder and THAT WORKS.

Thanks for your quick response, loving the project.

EDIT: Actually, tested with 7zip plain zip again, and now that also works. So what I think happened was that we were using an older version of love.js which resulted in a different error - i think... I'm confused, but using a .love file instead of folder seems to be key here.

The docs mention <input> can either be a folder or a .love file.. Is there any information how the folder path is supposed to be formatted?

Davidobot commented 3 years ago

I think I'll close this. I'll just specify that .love files are preferred over folders until I have time to look into why folder don't work.