Skip to content
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

ESM Support for Node 18-plus? (.mts -> .mjs) #294

Open
cwbuecheler opened this issue Jun 15, 2023 · 1 comment · May be fixed by #295
Open

ESM Support for Node 18-plus? (.mts -> .mjs) #294

cwbuecheler opened this issue Jun 15, 2023 · 1 comment · May be fixed by #295

Comments

@cwbuecheler
Copy link

cwbuecheler commented Jun 15, 2023

Greets,

I'm new to this plugin and have done some digging but currently I don't see any way of using .mts files to generate .mjs files when using sls deploy or similar. I know this is a relatively new approach from Node but it's really nice to not have to use the old module.exports syntax. I can compile my files directly by running tsc but sls deploy dies with the following error:

Error: Typescript compilation failed. Please ensure handlers exists with ext .ts or .js

If I'm missing something obvious, my apologies. If not, are there any plans to support ESMs (specifically for Node) in the future?

Thanks!

@cwbuecheler
Copy link
Author

Put in a quick PR that appears to resolve this. Works locally!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant