winglang / wing

A programming language for the cloud ☁️ A unified programming model, combining infrastructure and runtime code into one language ⚡
https://winglang.io
Other
4.6k stars 180 forks source link

can't bundle `aws-sdk` #6390

Closed eladcon closed 2 weeks ago

eladcon commented 2 weeks ago

I tried this:

Running an extern function that requires aws-sdk

class Util {
  extern "./lib.js" pub static inflight util(): void;
}

test "" {
  Util.util();
}
//lib.js
const AWS = require("aws-sdk");
exports.util = async () => {
  return "aaa";
};

This happened:

Error: A callback was registered through process.setUncaughtExceptionCaptureCallback(), which is mutually exclusive with using the `domain` module

I expected this:

No response

Is there a workaround?

No response

Anything else?

No response

Wing Version

No response

Node.js Version

No response

Platform(s)

No response

Community Notes

MarkMcCulloh commented 2 weeks ago

We could switch to using process.on("uncaughtException", ...) in the sandbox instead of process.setUncaughtExceptionCaptureCallback. We can do the same in the preflight process. Not sure what compromises there are for this, if any.

monadabot commented 2 weeks ago

Congrats! :rocket: This was released in Wing 0.73.16.