-
Notifications
You must be signed in to change notification settings - Fork 39
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
#err_require_esm issue #202
Comments
i've got a similar issue with using this lib on vercel
|
I got the same error, @quan-unizen were you able to solve it? |
@Macket @fedorovdg tagging the top contributors to take a look at this, guys I'm getting the same thing and issue is old and still not fixed. My Environment:
Setup is basic: install a fresh hardhat project with typescript, then add curvefi/api package. Write a sample .ts script and just import the api. import curve from "@curvefi/api"; and then run using this command:
or if you don't have shorthand installed:
Observe the error:
We literally can't use your package because if this. ts-node issue comments suggest operations with tsconfig and package.json files, but those broke the rest of hardhat project. |
I am also experiencing the same issue, I'm trying to integrate @curvefi/api in my nestjs backend (within an nx monorepo) and I got this error
|
@HadiKhai @MetaMmodern were you able to get it working? Same error, console Nodejs app. |
No |
It looks like that behavior started happening between @curvefi/[email protected] and @curvefi/[email protected] More specifically it may have been introduced in this pull request #151 and possibly one of these changes:
|
My workaround (tested with both node 18 and node 20) is:
More info there TypeStrong/ts-node#1007 (comment) |
Thanks guys. I was able to solve it two ways: first when running by UPD: I finally got rid of this problem. I was getting it when I added this library into my console application and my console app was CommonJs module, but the library is ESM (newest one). After I changed my app to ESM (that can work with CommonJs as well), it started building and working like charm. |
Hi guys,
I m trying to install the lib but always get issue like this?
Any idea to fix it?
The text was updated successfully, but these errors were encountered: