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

UnhandledRejection #62

Closed
erkbamyaci opened this issue Sep 2, 2019 · 9 comments · Fixed by #64
Closed

UnhandledRejection #62

erkbamyaci opened this issue Sep 2, 2019 · 9 comments · Fixed by #64

Comments

@erkbamyaci
Copy link

The package is listening all 'UnhandledRejection' errors and throwing it's own (h3-js) error from 'dist/hs-js.js', line: 10979 even if the source of the error is not h3-js package itself.

Is there a way to overwrite this 'UnhandledRejection' errors, what do you suggest?

@nrabinowitz
Copy link
Collaborator

What version of the library are you using? This was an issue several versions ago, but should now be fixed (see #7). I don't see any references to UnhandledRejection in the current build.

@nullRefErr
Copy link

@nrabinowitz Hey, I came across the same issue a day ago. I inspect the built file and found out the code below. Looks like unhandledRejection is still listening.

Packge version: "h3-js": "^3.5.0"

    Module["arguments"] = process["argv"].slice(2);
    process["on"]("unhandledRejection", abort);
-------------------------------------------------------------
  function abort(what) {
    if (Module["onAbort"]) {
      Module["onAbort"](what);
    }

    if (what !== undefined) {
      out(what);
      err(what);
      what = JSON.stringify(what);
    } else {
      what = "";
    }

    ABORT = true;
    throw "abort(" + what + "). Build with -s ASSERTIONS=1 for more info.";
  }

  Module["abort"] = abort;

@erkbamyaci
Copy link
Author

@nrabinowitz, thanks for the quick response.
I am also using version 3.5.0. I checked to be sure and I guess this is the latest version of the package.

Do you have any idea why we face this? Or is there a way to overwrite it?

@nrabinowitz
Copy link
Collaborator

Ok, I see it now (had the capitalization wrong). This is part of the generated Emscripten scaffolding code; my understanding was that we were removing it with the NODEJS_CATCH_EXIT=0 flag passed to Emscripten, but it's possible that either the flag has changed or is no longer being honored in the version of Emscripten we're using.

I will investigate and fix. In the meantime, if you are using h3-js in browser contexts, this part of the code should be removed in the dist/browser builds.

@nullRefErr
Copy link

@nrabinowitz thank you, I was using h3-js in a backend project but it is not a big deal right now. I will wait you to fix. Good luck

@erkbamyaci
Copy link
Author

@nrabinowitz thanks for the help. I will be waiting for the fix as well. Have a great day.

@nullRefErr
Copy link

@nrabinowitz any updates ?

@nrabinowitz
Copy link
Collaborator

Looks like the issue is here: emscripten-core/emscripten#9028

The issue is open, but it looks like there's a flag now to remove the line. I'll update emscripten and see if this fixes it.

@nullRefErr
Copy link

@nrabinowitz Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants