Skip to content

Emscripten wrapper modifies Node.js globals #629

Description

@donmccurdy

I'm trying to integrate Draco into glTF-Transform, and have hit an issue with the generated Emscripten wrapper. It includes the following:

process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);

The effect of that, unfortunately, is to create noisy output that obscures my own stack traces and user-facing warnings, where my CLI library would normally handle errors. Is it possible to build (and ideally publish) the npm package without this in the wrapper?

Activity

  1. donmccurdy commented on Sep 18, 2020

    @donmccurdy
    ContributorAuthor
  2. FrankGalligan commented on Oct 5, 2020

    @FrankGalligan
    Collaborator

    We are planning on a new release this month. We can investigate adding these options.

  3. donmccurdy commented on Dec 2, 2020

    @donmccurdy
    ContributorAuthor

    In the latest release, 1.4.0, I'm seeing a different but still similar line in both the encoder and the decoder:

    process.on("uncaughtException",function(a){throw a;});process.on("unhandledRejection",l);

    This has a similar effect as before unfortunately, obscuring errors from my own application with a stack trace that seems to come from Draco:

    RuntimeError: abort(g: "MY ERROR MESSAGE HERE".). Build with -s ASSERTIONS=1 for more info.
        at process.l (/Users/donmccurdy/Projects/glTF-Transform/node_modules/draco3dgltf/draco_encoder_gltf_nodejs.js:14:152)
        at process.emit (events.js:214:15)
        at processPromiseRejections (internal/process/promises.js:201:33)
        at processTicksAndRejections (internal/process/task_queues.js:86:32)
    

    Both the encoder and decoder include a similar line.

  4. FrankGalligan commented on Dec 2, 2020

    @FrankGalligan
    Collaborator

    @donmccurdy Does 1.4.0 not even work now? Or just the same brokenness for you as 1.3.6?

  5. donmccurdy commented on Dec 2, 2020

    @donmccurdy
    ContributorAuthor

    It seems like v1.4.0 just hasn't fixed this particular issue — as far as I can tell it's behaving basically the same as v1.3.6, but I haven't managed to get my own implementation (donmccurdy/glTF-Transform#147) fully updated yet, and haven't tried to update three.js.

  6. donmccurdy commented on Dec 8, 2020

    @donmccurdy
    ContributorAuthor

    Confirmed fixed in v1.4.1, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions