aws / aws-lambda-nodejs-runtime-interface-client

Apache License 2.0
180 stars 56 forks source link

ES module support #44

Closed majg0 closed 1 year ago

majg0 commented 2 years ago

https://aws.amazon.com/about-aws/whats-new/2022/01/aws-lambda-es-modules-top-level-await-node-js-14/

Also; is this maintained? Last commit Nov 3 2021, open issues and outstanding PRs.

darrinholst commented 2 years ago

So cracking open the latest amazon/aws-lambda-nodejs image I see this in UserFunction.js...

  // If still not loaded, try .js, .mjs, and .cjs in that order.
  // Files ending with .js are loaded as ES modules when the nearest parent package.json
  // file contains a top-level field "type" with a value of "module".
  // https://nodejs.org/api/packages.html#packages_type
  const loaded =
    (pjHasModule && _tryAwaitImport(lambdaStylePath, ".js")) ||
    _tryAwaitImport(lambdaStylePath, ".mjs") ||
    _tryRequireFile(lambdaStylePath, ".cjs");

so it looks to have been added, but hasn't made it up to this repo yet?

tforster commented 2 years ago

It's now more than halfway through June. Is there any update on this issue? It's pretty critical not to be able to use ES modules in 2022.

daniel-gato commented 1 year ago

Same here, we need this asap.

govindrai commented 1 year ago

Don't want to repeat the same request but it would be great it to get some response from maintainers

krk commented 1 year ago

This is fixed in https://github.com/aws/aws-lambda-nodejs-runtime-interface-client/pull/70.