Replies: 2 comments 1 reply
-
Running into an error related to this for wagmi. When using vitest (vite under the hood), the
Can workaround this by changing code from:
To:
But using |
Beta Was this translation helpful? Give feedback.
1 reply
-
This will not be added to v5 (the build process is very complex) as I am trying to focus on my time on v6, which provides ESM for node. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the Feature
Hi.
Are there any plans to update the build configuration to support ESM in NodeJS environments? It currently incorrectly assumes that ESM is always within a browser context and therefore fails to leverage the native
crypto
package. This is an issue for pretty much every project that builds and runs their code base withesbuild
based tools liketsup
ortsx
as well as vite (yes, vite can also be used in a NodeJS environment!), etc.While debugging this, I combed through the current rollup based build configuration in ethers.js and think it's possible to seamlessly upgrade it to
tsup
while also properly declaring the relevant package.json fields (hopefully explicitly declaringexports
), adding support for ESM in NodeJs environments while maintaing the current behavior for browser environments.Let me know if you'd be open to exploring this. I think ethers.js would greatly benefit from dedusting the build config a bit :-)
Code Example
No response
Beta Was this translation helpful? Give feedback.
All reactions