Skip to content

Incompatibility with Bluebird-based libraries (e.g. AggLayer’s lxly.js) due to SES stripping Promise.try #3367

@AkshatGada

Description

@AkshatGada

When bundling and loading lxly.js (AggLayer’s cross-chain client) inside a MetaMask Snap, the Snap’s SES sandbox immediately crashes with errors around Promise.try being removed. Under the hood, lxly.js depends on Bluebird, which monkey-patches the global Promise by adding methods like Promise.try. SES proactively deletes any non-standard intrinsics (including Bluebird’s augmentations), and as soon as Bluebird code attempts to access or redefine Promise.try, it throws an irrecoverable error:

✖ Error: Failed to evaluate snap bundle in SES. This is likely due to an incompatibility with the SES environment in your snap. Received the following error from the SES environment: Removing intrinsics.Promise.try {}

Because SES strips these extensions at startup, lxly.js (and any library that pulls in Bluebird) cannot function in a Snap.

Links to lxly.js :-
https://www.npmjs.com/package/@maticnetwork/lxlyjs
https://github.com/0xPolygon/lxly.js
https://github.com/BrianSeong99/Agglayer_UnifiedBridge

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions