-
Notifications
You must be signed in to change notification settings - Fork 36
ES Module support #266
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
Comments
Hi @edeesis. Thanks for the report. We've scheduled work to support this with our js client. Unfortunately it's not quite as simple as updating the UserFunction.js, since the new code depends on a native library called deasync to support top level await. This means we must publish separate layers for ARM64 and x86 architectures, and update some of our other tooling as well. We will update this issue with our progress. |
I enabled {
"errorType": "Runtime.HandlerNotFound",
"errorMessage": "index.post is undefined or not exported",
"stack": [
"Runtime.HandlerNotFound: index.post is undefined or not exported",
" at HandlerNotFound.ExtendedError [as constructor] (/opt/nodejs/node_modules/datadog-lambda-js/runtime/errors.js:113:28)",
" at new HandlerNotFound (/opt/nodejs/node_modules/datadog-lambda-js/runtime/errors.js:131:42)",
" at load (/opt/nodejs/node_modules/datadog-lambda-js/runtime/user-function.js:151:15)",
" at Object.<anonymous> (/opt/nodejs/node_modules/datadog-lambda-js/handler.js:65:59)",
" at Module._compile (internal/modules/cjs/loader.js:1085:14)",
" at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)",
" at Module.load (internal/modules/cjs/loader.js:950:32)",
" at Function.Module._load (internal/modules/cjs/loader.js:790:12)",
" at Module.require (internal/modules/cjs/loader.js:974:19)",
" at require (internal/modules/cjs/helpers.js:93:18)"
]
} I assume it's related to this issue and lack of support? |
ESM support is released in Layer version 78 and version 6.78 of this library! |
Thanks @astuyve! Fantastic news, and happy for the relatively quick turn around given the complexity of the change required. |
Just a bit more work to get this working :D #295 |
We tried to add the DD layer to our ESM built lambda but found that if we do the lambda cannot import |
Expected Behavior
According to this issue, Lambda has updated the latest version of the amazon/aws-lambda-nodejs image to support the top level await by adding the following code:
Since this repo now has a vendored version of UserFunction.js, this code should be updated to work appropriately.
Actual Behavior
An error is raised on start up when attempting to load a ES Module file. See stacktrace below.
Steps to Reproduce the Problem
Specifications
Stacktrace
The text was updated successfully, but these errors were encountered: