You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
@metamask/snaps-utils imports deepmerge without declaring it in dependencies (and similar in snaps-rpc-methods, snaps-jest) #4181
Since #3802, packages/snaps-utils/src/manifest/manifest.ts imports deepmerge at runtime, while packages/snaps-utils/package.json lists deepmerge only in devDependencies, so @metamask/snaps-utils/node fails to load on a fresh install:
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'deepmerge' imported from .../node_modules/@metamask/snaps-utils/dist/manifest/manifest.mjs
require('@metamask/snaps-utils/node') fails with Cannot find module 'deepmerge', and a plain npm install of @metamask/[email protected], @metamask/[email protected], or @metamask/[email protected] fails the same way because they import @metamask/snaps-utils/node and nothing in their dependency trees pulls in deepmerge.
Two other packages in the monorepo also import runtime dependencies listed only in devDependencies (resolved via hoisting under npm, failing with ERR_MODULE_NOT_FOUND under non-hoisted resolution such as Yarn PnP or pnpm with hoistPattern: []):
@metamask/[email protected]: src/permitted/middleware.ts imports @metamask/json-rpc-engine and src/permissions.ts imports @metamask/json-rpc-engine/v2, while @metamask/json-rpc-engine is only in devDependencies.
@metamask/[email protected]: src/helpers.ts, src/matchers.ts, and src/internals/server.ts import @metamask/snaps-utils and @metamask/snaps-utils/node, while @metamask/snaps-utils is only in devDependencies.
Expected: @metamask/snaps-utils, @metamask/snaps-rpc-methods, and @metamask/snaps-jest declare their runtime imports in dependencies so they load without relying on hoisting or extra installs.
Activity