Module Types
Pure ESM
In the best interest of moving wagmi forward and aligning with the future of the web, wagmi
is a pure ESM module by default for a number of reasons:
- Most modern libraries, frameworks & browsers (ie. Node 12+, Next, Vite, Vitest, etc.) already support pure ESM,
- To avoid Dual Package Hazard,
- Native ESM support has been out for a while now (since 2019).
Some libraries (such as Remix or Jest) may require additional config for ESM support.
CJS (Escape Hatch)
In the rare scenario you cannot get the pure ESM module to work with your environment, you can retreat to the CJS Escape Hatch module. The CJS module is available via the cjs
tag on NPM:
npm i wagmi@cjs