-
-
Notifications
You must be signed in to change notification settings - Fork 378
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
(Aware of other issues) No "exports" main defined in /var/task/node_modules/@middy/core/package.json #1208
Comments
We're facing the same issue and this blocks us from upgrading v.4.7.0 -> v.5 |
Are you both using TypeScript? From my understanding TS transpiles (tsc?) to commonJS first before importing dependencies, which would cause this issue. |
It would be disappointing if the library no longer supports TS. I have encountered this issue in JS and TS with lambdas, Nodejs, and other frameworks. |
Does the sample compiler options found at https://middy.js.org/docs/intro/typescript/ need to be updated? If so, a PR would be most welcome. |
Yes we're using typescript.. that sounds like it would be the issue and needs updating. Unfortunately I'm not too familiar with how the PR would look like for this fix |
Hello, I spent a bit of time trying to troubleshoot this with @willfarrell today and we were not able to fully reproduce your issue, this is what we did:
|
Will try troubleshooting this week with your setup above, I wonder if it's only an issue once deployed to AWS for some reason |
Describe the bug
Hello, I saw the other bugs reported on this issue and how it's normally caused by using CJS in v5 but I've migrated to ES6 completely and still getting this
CustomMessage failed with error No "exports" main defined in /var/task/node_modules/@middy/core/package.json.
To Reproduce
Package.json is using
"type": "module"
tsconfig.json has
cdk.json has
my lambda is exported as
Environment
The text was updated successfully, but these errors were encountered: