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

Errors when trying to run simplest possible project #21

Closed japhib closed 3 years ago

japhib commented 3 years ago

I've made the simplest possible test project using Love2D:

function love.draw()
    love.graphics.setColor(1, 0, 0, 1)
    love.graphics.rectangle('fill', 20, 20, 30, 30)
end

This (obviously) works with a standalone player, but it's not working at all when I try to run it with love-js. The build process works just fine. The script (main.lua) is in a folder by itself, called love-test. I run the command like this:

love-js love-test love-test-game

and then serve it like this:

cd love-test-game
python -m http.server 8000

and the page loads with the Love2d logo and everything, but the game doesn't load at all -- there's just a message box that says "An error occurred before the game window could be initialised. Please check the console!"

These are the errors in the console:

image

Other things I've tried, in various combinations, only to have the exact same error:

  1. Building in compatibility mode
  2. Building from a .love archive instead of the folder itself
  3. Building the spec tests from this repo, instead of my simple test

... and the same thing always happens.

Any ideas what I'm doing wrong here? Or maybe you could point me in the right direction for how to begin debugging, or at least providing more information?

Davidobot commented 3 years ago

I think I broke building from folders at some point. Try zipping up your file as a love file.

japhib commented 3 years ago

That also doesn't work. I've tried that with zipping it up both from the Windows default zip mechanism from windows explorer, and with 7-zip, and same error every time.

However! When I use the Linux Subsystem for Windows to both zip up the LOVE archive and call love.js, it works!

japhib commented 3 years ago

But, then I get the same error when trying to build an actual game rather than just a super simple example. I'm guessing there's some logging we should have that isn't happening. I'll try building from source myself and see if I can figure out what's wrong here