-
Notifications
You must be signed in to change notification settings - Fork 112
Need nodejs14 es6 module support #38
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
You can work around it by making a file: shim.js: module.exports = require("."); Set your handler to "shim.handler". In package.json set "main" to "./handler.mjs", and then you can |
@clequinio5 - Perhaps I'm misreading your question, in which case more detail would be appreciated, but ESM / ES Modules are supported in Docker-based JavaScript Lambdas. There are some tricks, covered in this blog post announcing ESM modules in Lambda, primarily that you need to either have a I created a repo to demonstrate the entire process, including if you want to wrap an existing CommonJS application with an ESM handler for async initialization: https://github.com/huntharo/lambda-docker-typescript-esm Below you can see that the handler cannot access |
@huntharo this workaround helped me due to aws/aws-lambda-nodejs-runtime-interface-client#44 (comment) |
Entrypoint in docker still use the es5 require synthax to import module. This leads to an exception, trying to test a nodejs14 lambda with es6 module synthax.
The text was updated successfully, but these errors were encountered: