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

Could not initialize SDL joystick subsystem (Gamepads not supported) on firefox #41

Open abhimonk opened 3 years ago

abhimonk commented 3 years ago

My game does not use any joystick-related functionality, it only uses love.keypressed and love.keyreleased. When building (using the -c flag) and running in firefox, I get the following error in a popup window:

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

When checking the console, I see the following message Could not initialize SDL joystick subsystem (Gamepads not supported)

The game runs fine in chrome with the -c flag, no issues. This only seems to happen on firefox. Is there a special way I need to handle input to resolve this? I've checked my project and I don't have any gamepad support enabled, I only use basic keyboard functions from love2D. Is there a way around this? I'm using firefox version 91.0.

EDIT: On second look, it seems to work fine on itch.io with the web version, despite throwing the above error when running it through a local webserver. Perhaps it has something to do with my local server? I'm using npx http-server to run the game locally in a browser, but when I run it through itch.io, it seems to work fine.

kalbfled commented 3 years ago

I ran into this issue too: Ubuntu 20.04, Firefox 91.0. My game also works on Itch.io.

rameshvarun commented 2 years ago

This is likely due to browsers limiting certain APIs to be available on HTTPS origins only.

You can work around this by adding t.modules.joystick = false to your conf.lua