Troubleshooting

Further support

Send us a message in the Pangea Discord:

Troubleshooting

ESM-only compile = commonjs compilation is not supported

Pangea SDK uses pure ESM-compiled packages. You will not be able to consume the Pangea 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 veramo.io libraries which use pure ESM components. See here: https://discord.com/channels/878293684620234752/1200026960307437578/1249723788346785842

You can see here our journey to understand and upgrade all our repositories to pure ESM compilation: https://github.com/Tonomy-Foundation/Tonomy-ID-SDK/issues/336. You can see the specific changes we made and the typescript/jest compilation settings in our various Pangea infrastucture:

yarn package management linking

Try use yarn with node-modules:

.yarnrc.yml
nodeLinker: node-modules

Error: Cannot read 'getResolver' of undefined

This has been observed in vite/quasar apps in development mode. To resolve see here: https://github.com/decentralized-identity/ethr-did-resolver/issues/186#issuecomment-1870230086

TypeError: Failed to execute 'fetch' on 'Window'

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()

import { setFetch } from '@tonomy/tonomy-id-sdk';

setFetch(window.fetch.bind(window));

Last updated