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

"Exception thrown, see JavaScript console" instead of game window without compatibility mode #25

Closed JasonNumberThirteen closed 3 years ago

JasonNumberThirteen commented 3 years ago

Hi, There's a problem which I have to report. I tried to launch my game on Python localhost without compatibility mode due to unavoidable bug with disappearing music in less than a second. Though the game runs almost perfectly on compatibility mode (besides this mess with music), it fails on "normal" mode giving tons of errors linked below. I don't understand what's going on.

consoleOutput

Notice that this issue occurs whether you export your game in the "normal" mode, not "compatibility". Tested on Chrome, Firefox and Edge, all of them give the same effect: "Exception thrown, see JavaScript console.". Does somebody know what's wrong with it?

Davidobot commented 3 years ago

The music issue in compat mode is known - the workaround is rewriting love's audio system. Which I plan to do eventually.

The main issue here is the MIME error. Your browsers seem to be doing strict typechecking about running things. Do the online demos for you? If so, did you modify the .html file for your game?

I think someone else had this error when testing in incognito.

Reading: https://emscripten.org/docs/compiling/Deploying-Pages.html (ctrl+F "mime")

Do you put your game in a .love file before running love.js on it?

JasonNumberThirteen commented 3 years ago

Online demos work as expected. All of them. I didn't modify the default HTML structure at all. Of course I've put my game into ".love" file before running.

JasonNumberThirteen commented 3 years ago

I still can't solve the problem. Any ideas?

JasonNumberThirteen commented 3 years ago

OK, I've found in the "love.js" the "text/plain" string, but even when I changed this to suggested entries taken from the same link, it doesn't solve the problem. I still have the same errors. Is there any other "text/plain" string I need to change?

Davidobot commented 3 years ago

Sorry, I don't have the time to look into this right now. I'll ping a few people that I think ran into similar issues, maybe they will be able to help you. @thomasgoldstein @Sheepolution

JasonNumberThirteen commented 3 years ago

Sorry, I don't have the time to look into this right now. I'll ping a few people that I think ran into similar issues, maybe they will be able to help you. @thomasgoldstein @Sheepolution

OK, thanks for response.

Davidobot commented 3 years ago

Hm, re-reading the error log seems to suggest maybe your browser is caching different versions of the worker.js and that's why it's not working? I'll close this as there is no news.

JasonNumberThirteen commented 3 years ago

@Davidobot Wait, I've got something! I think you may be right, because I've just launched the same template on my other PC and it worked! The same command: "python -m http.server". Tested on Chrome and Python 3.8.1 (32-bit). I made the second test on the same PC, but this time on "XAMPP" and it also launched (there were some errors linked below, but it became accessible)!

Here's the output on "XAMPP" localhost (Google Chrome, Python 3.91 (64-bit)): xampp console

Any clues what it means?

Davidobot commented 3 years ago

Those errors occur because the webserver needs to specify the kind of content it is loading. I might be able to force the MIME type somewhere but I'll have to dig in, which I don't have time for at the moment. XAMP probably doesn't do this by default.

JasonNumberThirteen commented 3 years ago

OK, thanks, anyway. The most important is it finally works and I don't have to use any workarounds for "buggy" music in compatibility mode. I'm going to use "XAMPP" if I can't figure how to fix this "worker.js" problem on Python localhost.

After all, good job! It's a good tool.