Open mmv08 opened 2 years ago
If you use NodeJS and ESModules, the library imports do not work as expected, you can see an example in this issue: https://ethereum.stackexchange.com/questions/133776/error-in-deploying-a-safe-methods-is-empty
It means that for ESM you have to do this:
import SafeCoreSDK from '@gnosis.pm/safe-core-sdk' console.log(SafeCoreSDK) // { // default: SafeCoreSDK // } const SDK = SafeCoreSDK.default
Separate builds for esm and commonjs like other libraries do. An example - https://github.com/gnosis/evm-proxy-detection
Can't see any
I've also just discovered that this completely breaks types with typescript
Example on how to do this based on safe-apps-sdk https://github.com/safe-global/safe-apps-sdk/pull/512
safe-apps-sdk
Context / issue
If you use NodeJS and ESModules, the library imports do not work as expected, you can see an example in this issue: https://ethereum.stackexchange.com/questions/133776/error-in-deploying-a-safe-methods-is-empty
It means that for ESM you have to do this:
Proposed solution
Separate builds for esm and commonjs like other libraries do. An example - https://github.com/gnosis/evm-proxy-detection
Alternatives
Can't see any
Additional context