-
-
Notifications
You must be signed in to change notification settings - Fork 19
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 changes in v3.0.0+ have some conflicts with my app #23
Comments
The bottom line is a NestJS developer can not add this package to his project without changing the default configurations. Since the majority of the community is still using |
@xxczaki Any idea on this? |
Same here, There is another thread about the breaking changes here but the developer doesn't seem to care that he broke his package for over half of the module users who use NodeJS. |
@vahidvdn I am maintaining an ES2017 fork of this package at https://www.npmjs.com/package/cashify-es2017 , which means it can be used as any other package. |
Upgrading to the latest version of nestjs (v10) fixed the issue |
I'm the author of nestjs-cashify. I decided to update my package as well. I'm encountering some issues after updating to Cashify 3+ and building my package. Since my package ts configuration is set to
es6
notes2020
.When I want to use my package in a regular NestJS project (in my example folder), I get these errors:
This makes sense since my project is set to "es6" and when I build, it uses "require" for ES module (Cashify module is now ESM from version 3): This is the error: require() of ES Module /index.js from /cashify.module.js not supported.
Then I decided to set my project to "es2020" as well. Now, this error is gone (since in my build result it's not using
require
anymore, it's using import statement).In my example folder (regular NestJS project), this config is set:
"target": "es2017",
Now I see the following error:
Even though that's not a good idea to change my example project's configuration (since all NestJS developers will have this conflict), I tried to fix this anyway. I changed it to
es2020
as well.This time, I get the following errors:
I also tried to set "type": "module" in package.json file and then I see this error:
Any idea?
The text was updated successfully, but these errors were encountered: