Error LavaMoat - property "Reflect" of globalThis is inaccessible under scuttling mode

Although I have set scuttleGlobalThis.enable to false in runtime-lavamoat.js still I get this error.
I’m using MetaMask snap and trying to use fetch to call an external API.
I tried rebuilding MetaMask flask in dev mode in order to turn scuttleGlobalThis off however I always get the error.

I also encountered the same problem, but I don’t know in which file I should configure scuttleGlobalThis=true?

Where is your runtime-lavamoat.js located?

Hi @user3149 could you show the full error output @Mike_9 do you see the same error message?

Yes, I encountered the same error.
Error output:
Exception: Error: LavaMoat - property “Reflect” of globalThis is inaccessible under scuttling mode.

@user3149

This error shows up when the reference to Reflect is reached in a way it’s not supposed to. It may be a bug in the snaps runtime environment or a package attempting to create new contexts (windows/iframes). But to know that, we’d need a sample to reproduce and see for ourselves. It’d also be helpful if you could identify where the Reflect reference is that causes the error. As for solving it by turning off scuttling:

  1. Turning off scuttling in MetaMask will not affect Snaps, they’re isolated and running under a separate instance of LavaMoat with scuttling configured elsewhere. You will not be able to turn off scuttling for snaps by forking MM and changing the sources.
  2. Turning off scuttling for development is not going to serve you well, because we won’t have a no-scuttling version of MM so your snap needs to work with scuttling on.

@user3149 could you please open a new issue in Issues · MetaMask/snaps · GitHub