-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explore adding a ESM build to passkey/4337 packages #395
Comments
I looked into the original error message and discovered the problem was in the |
…bal/safe-passkey` and update imports in the example app (#488) When trying to solve #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: - 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](https://github.com/hildjj/node-cbor) - 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
Description
Currently, we're exporting all the builds as
commonjs
and a lot of tooling is expecting es module builds nowadays, and sometimes the interop mechanism has bugs (e.g., #389 (comment))Hardhat doesn't support ESM with TypeScript, so the only solution we can try is to add a second typescript config and use it for the build
The text was updated successfully, but these errors were encountered: