Uncaught (in promise) TypeError: eventHandler.target is null
I'm compiling with Nim 1.6.6 and Emscripten 3.1.19 with `nimble webr` and when I load it in Firefox I get this error in the console (and no game shows up):

```
Uncaught (in promise) TypeError: eventHandler.target is null
    registerOrRemoveHandler http://127.0.0.1:8090/carrider.js:1
    registerMouseEventCallback http://127.0.0.1:8090/carrider.js:1
    _emscripten_set_mousemove_callback_on_thread http://127.0.0.1:8090/carrider.js:1
    createExportWrapper http://127.0.0.1:8090/carrider.js:1
    callMain http://127.0.0.1:8090/carrider.js:1
    doRun http://127.0.0.1:8090/carrider.js:1
    run http://127.0.0.1:8090/carrider.js:1
    runCaller http://127.0.0.1:8090/carrider.js:1
    removeRunDependency http://127.0.0.1:8090/carrider.js:1
    receiveInstance http://127.0.0.1:8090/carrider.js:1
    receiveInstantiationResult http://127.0.0.1:8090/carrider.js:1
    promise callback*createWasm/instantiateAsync/< http://127.0.0.1:8090/carrider.js:1
    promise callback*instantiateAsync http://127.0.0.1:8090/carrider.js:1
    createWasm http://127.0.0.1:8090/carrider.js:1
    <anonymous> http://127.0.0.1:8090/carrider.js:1
```

<img width="773" alt="Screen Shot 2022-08-18 at 10 15 20 PM" src="https://user-images.githubusercontent.com/161727/185528437-9cea24ed-1929-463e-85d9-d89da2278f56.png">

I'm about to try with earlier Emscripten versions to see if that's the reason. Do you happen to have a recommended Emscripten version?
