-
-
Notifications
You must be signed in to change notification settings - Fork 266
fix: Downgrade multiformats to ^9.9.0 to avoid ESM-only dependency
#6920
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
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
| * Partial type definitions for `multiformats/cid`. This only covers the parts | ||
| * used in the codebase. | ||
| */ | ||
| declare module 'multiformats/cid' { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
multiformats has type definitions but they're not included in the package.json's exports fields, so they are not picked up by TypeScript. We only use a very limited subset of the package's functionality anyway, so I added a minimal definition to cover it.
Gudahtt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
…r/multichain-transactions-controller * origin/main: (35 commits) feat: `JsonRpcEngineV2` (#6176) Release 641.0.0 (#6940) feat: Add transaction emulation actions (#6935) Release/640.0.0 (#6934) fix(core-backend): control randomness to fix flaky test (#6936) chore: Add `@metamask-previews/*` to NPM age gate exceptions (#6937) Release/639.0.0 (#6931) feat: make getCryptoApproveTransactionParams synchronous (#6930) feat: add new actions to `KeyringController` (#6928) feat: add `getAccounts` to `AccountsController` (#6927) chore: remove `Monad Mainnet` single call balance contract and add into account v4 (#6929) Release/638.0.0 (#6923) fix: Downgrade `multiformats` to `^9.9.0` to avoid ESM-only dependency (#6920) Release/637.0.0 (#6919) feat(account-tree-controller): add callbacks for hidden and pinned data (#6910) Release 636.0.0 (#6918) fix(core-backend): reconnection logic (#6861) fix: Tx state listener and signature coverage (#6906) Release/635.0.0 (#6917) fix(base-controller): add TypeScript declaration file for legacy module resolution (#6915) ...
Explanation
assets-controllerscurrently uses an ESM-only version ofmultiformats, which is not supported in the Browserify pipeline used by the extension. I suggest downgrading to ^9.9.0` (the latest CJS version), and updating to a newer version once we drop Browserify in the extension instead.References
Checklist
Note
Downgrades
multiformatsto^9.9.0and updates IPFS CID handling to a CJS-compatible import with added type stubs.multiformatsfrom^13.1.0to^9.9.0inpackages/assets-controllers/package.json.src/assetsUtil.ts, replace dynamicimport('multiformats')withimport { CID } from 'multiformats/cid'forgetIpfsCIDv1AndPath.multiformats/cidatsrc/types/vendor/multiformats.d.ts.multiformatsdowngrade.Written by Cursor Bugbot for commit 8be7611. This will update automatically on new commits. Configure here.