Troubleshooting
Last updated
Last updated
Send us a message in the :
channel
channel for anything sensitive
Tonomy SDK uses pure ESM-compiled packages. You will not be able to consume the Tonomy SDK in a common project such as a default nodejs 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?
Our use of the libraries which use pure ESM components. See here:
You can see here our journey to understand and upgrade all our repositories to pure ESM compilation: . You can see the specific changes we made and the typescript/jest compilation settings in our various Tonomy infrastucture:
React native (mobile):
React app with Vite (website):
Nestjs (server):
SDK (typescript):
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()
This has been observed in vite/quasar apps in development mode. To resolve see here: