Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebPlayer throws multiple errors whenever something is typed on the Browser's Console. #2806

Closed
jetrotal opened this issue Jun 10, 2022 · 1 comment · Fixed by #2814
Closed
Labels
Emscripten WebAssembly/JavaScript port for web browsers Patch available
Milestone

Comments

@jetrotal
Copy link
Contributor

jetrotal commented Jun 10, 2022

Name of the game:

Every Game.

Player platform:

WebPlayer(emscripten)

Attach files (as a .zip archive or link them)

Most recent builds of the WebPlayer
testing players from https://easyrpg.org/play/pr2779/
to https://easyrpg.org/play/master/

Describe the issue in detail and how to reproduce it:

Usually I use the Browser's Console to implement and debug stuff on the webplayer.

After updating it to a recent version, every time I type something on the console, it points to an generic error:
image


Looks like the errors are related to the list of variables that the console input generates...?

image

  • If I type ";" or "i" the error does not happens.

  • When typing "i", if I move down to "If", it throws an error...

It seems like it happens whenever that list can't find a variable:

  • "i" does not produce an error, because the list points to a var named "i" on the page.

  • "M" produces an error, because the list points to "Map" which is a generic function.

  • "Mo" does not produces an error, it points to the var "Module".


The error happens before the wasm is loaded. Would it be exclusive to the index.js file?

maybe the console is walking through the entire index.js and hitting something problematic on that ?


Right now, i'm using this dirty fix:
If the error is an order to check the console, it wont appear on the console, just on the status div.

Module.printErr = (...args)=>{
     if (args[0] === '[post-exception status] Exception thrown, see JavaScript console…') return;
        console.error(...args);
    }

Maybe adding a "dismiss" button on the status texts that appears on top could also help on this dirty fix.


The root of the problem may be closer to this function, tho:

window.addEventListener("error", ()=>{
    Module.setStatus("Exception thrown, see JavaScript console…");
    Module.setStatus = (text=>{
        if (text)
            Module.printErr(`[post-exception status] ${text}`)
    }
    )
}
);

I don't know what happened to make the window detect changes on the console input as errors...

Sam, from discord, is facing the same issues since he updated his repo:
ynoproject/ynoengine@ae7a33d

Maybe it is a good source to check diff at index.js...?


The issue seems harmless, nothing else on the player changes.
But it's very annoying to write code on the console, while it's throwing erros every time you type something.
Thanks in advance!


OK, update:

image
The error does not happen on the beta builds of chrome, it is a browser related error 😑

@carstene1ns carstene1ns added the Emscripten WebAssembly/JavaScript port for web browsers label Jun 14, 2022
@carstene1ns
Copy link
Member

Upstream bug, can be worked around (by checking event.defaultPrevented)

https://stackoverflow.com/a/72402135

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Emscripten WebAssembly/JavaScript port for web browsers Patch available
Development

Successfully merging a pull request may close this issue.

2 participants