Troubleshooting
Last updated
Last updated
We have adopted ESM syntax for the Tonomy codebase because of dependencies that we use that have taken a "pure ESM" stance.
You cannot consume the Tonomy SDK in a Commonjs project such as a default Node.js or Jest compiler.
Please change your compiler to target ESM.
Ensure "type": "module"
in package.json
Use Nodejs ≥ 20.00
You may also need to set the environment variable NODE_OPTIONS="--experimental-vm-modules"
What is causing this?
We use the libraries, which use pure ESM components. See for more details. Check out our to pure-ESM.
jsonld
ecosystemThe Tonomy library use the Verifiable Credentials libraries (like @veramo/credential-ld
) which depend on a set of libraries from the jsonld
ecosystem which weren't designed with the same multi-platform targets in mind. Forks of these dependencies exist, that work in all environments where Veramo should work, but you have to aid your package manager in finding them.
The solution is to add a resolutions
(or overrides
) block to your package.json
file and replacing the problematic dependencies:
Different package managers use different configurations for such overrides:
Try use yarn with node-modules:
You need to override the fetch object used by the SDK when your app loads. Do this at the same time as you call setSettings()
See the for more details.
If your project is a react-native app, then you will also benefit from replacing isomorphic-webcrypto
with the
See the for more details.
This has been observed in vite/quasar apps in development mode. To resolve see here:
Send us a message in the :
channel
channel for anything sensitive