When trying to solve https://github.com/safe-global/safe-modules/issues/395, I looked at the original error that triggered the discussion of adding an ESM build to the packages. I thought that the error was due to a bug in the bundler's ESM interoperability mechanism, but I realised that actually the issue was in the cbor package and compatibility with the browser environment.
Fixes compatibility of the @safe-global/safe-passkey with the browser environment by switching from cbor to cbor-web package as recommended in the package readme
Use the @safe-global/safe-passkey code in the example app
Updates the upstream bundler image TAG because it seems like they switched branch names
When trying to solve https://github.com/safe-global/safe-modules/issues/395, I looked at the original error that triggered the discussion of adding an ESM build to the packages. I thought that the error was due to a bug in the bundler's ESM interoperability mechanism, but I realised that actually the issue was in the
cbor
package and compatibility with the browser environment.When you import a js module, the code will get evaluated regardless of it use: https://www.perplexity.ai/search/does-javascript-evaluate-an-im-y4Zv1HKiQNmqxnHd1HJ1SA#0 (we may not use any of the functionality that's actually incompatible but because the code gets evaluated and it may imported a package that's unavailable in browser)
This PR:
@safe-global/safe-passkey
with the browser environment by switching fromcbor
tocbor-web
package as recommended in the package readme@safe-global/safe-passkey
code in the example app