Disable LavaMoat?

i follow this link try Build the MetaMask extension for disable lavamoat
/t/can-i-disable-lavamoat/24845/4
but i am not share with 3. 4. step
3. Use the search function (press Ctrl + Shift + F on Windows or Cmd + Shift + F on Mac) to find the line of code that contains “scuttleGlobalThis:” and set it to “false”.
4. Copy the .metamaskrc.dist file to .metamaskrc, and replace the INFURA_PROJECT_ID with your own personal API key using the search function.
(More info on that step in the README.md.)

  1. i try to INFURA_PROJECT_ID=INFURA API KEY
    i am not share is INFURA_PROJECT_ID=INFURA API KEY
    or INFURA_PROJECT_ID=‘INFURA API KEY’

  2. i open .builds.yml and Modifications as follows
    buildTypes:
    main:
    features:

    • build-main

    Additional env variables that are specific to this build

    env:

    • INFURA_PROD_PROJECT_ID: INFURA API Key
    • SEGMENT_PROD_WRITE_KEY
    • INFURA_ENV_KEY_REF: INFURA_PROD_PROJECT_ID
    • SEGMENT_WRITE_KEY_REF: SEGMENT_PROD_WRITE_KEY

    Main build uses the default browser manifest

    manifestOverrides: false

beta:
features:
- build-beta
env:
- INFURA_BETA_PROJECT_ID: INFURA API Key
- SEGMENT_BETA_WRITE_KEY
- INFURA_ENV_KEY_REF: INFURA_BETA_PROJECT_ID
- SEGMENT_WRITE_KEY_REF: SEGMENT_BETA_WRITE_KEY
# Modifies how the version is displayed.
# eg. instead of 10.25.0 → 10.25.0-beta.2
isPrerelease: true
# Folder which contains overrides to browser manifests
manifestOverrides: ./app/build-types/beta/manifest/

this is cmd error

C:\Users\60\Desktop\100\MetaMask\MetaMask-extension>yarn dist
Building lavamoat runtime file (scuttling is on)
Running task “dist”…
Starting ‘dist’…
Starting ‘clean’…
Finished ‘clean’
Starting ‘styles:prod’…
LavaMoat: ignoring write attempt to read-access global “process”
LavaMoat: ignoring write attempt to read-access global “__dirname”
LavaMoat: ignoring write attempt to read-access global “__filename”
LavaMoat: ignoring write attempt to read-access global “Buffer”
Finished ‘styles:prod’
Starting ‘scripts:core:dist:standardEntryPoints’…
Starting ‘scripts:core:dist:contentscript’…
Starting ‘scripts:core:dist:disable-console’…
Starting ‘scripts:core:dist:sentry’…
Starting ‘static:prod’…
Starting ‘manifest:prod’…
Finished ‘manifest:prod’
Finished ‘static:prod’
scripts:core:dist:contentscript: MetaMask build: Encountered an error while running task “scripts:core:dist:contentscript”.
scripts:core:dist:contentscript: TypeError: Tried to access a declared, but not defined environmental variable “INFURA_PROJECT_ID”
Why am I seeing this: “INFURA_PROJECT_ID” is declared in builds.yml, but had no actual value when we tried loading it.
How do I fix this: You could provide a default value for the variable in builds.yml under “env” property and commit to git. For example:
env:
- INFURA_PROJECT_ID: ‘’
at Variables.get (C:\Users\60\Desktop\100\MetaMask\MetaMask-extension\development\lib\variables.js:32:7)
at getInfuraProjectId (C:\Users\60\Desktop\100\MetaMask\MetaMask-extension\development\build\scripts.js:126:22)
at setEnvironmentVariables (C:\Users\60\Desktop\100\MetaMask\MetaMask-extension\development\build\scripts.js:1189:24)
at eval (C:\Users\60\Desktop\100\MetaMask\MetaMask-extension\development\build\scripts.js:847:11)
at async eval (C:\Users\60\Desktop\100\MetaMask\MetaMask-extension\development\build\task.js:123:7)
at async Object.eval [as scripts:core:dist:contentscript] (C:\Users\60\Desktop\100\MetaMask\MetaMask-extension\development\build\task.js:113:5)
at async runTask (C:\Users\60\Desktop\100\MetaMask\MetaMask-extension\development\build\task.js:30:5)
at async defineAndRunBuildTasks (C:\Users\60\Desktop\100\MetaMask\MetaMask-extension\development\build\index.js:272:3)
MetaMask build: Encountered an error while running task “dist”.
Error: MetaMask build: runInChildProcess for task “scripts:core:dist:contentscript” encountered an error “1”.
at ChildProcess.eval (C:\Users\60\Desktop\100\MetaMask\MetaMask-extension\development\build\task.js:97:13)
at Object.onceWrapper (node:events:628:26)
at ChildProcess.emit (node:events:513:28)
at ChildProcess.cp.emit (C:\Users\60\Desktop\100\MetaMask\MetaMask-extension\node_modules\cross-spawn\lib\enoent.js:35:29)
at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)

not sure how to setting right with 4. builds.yml

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.