App code snapshot error


I’m working on sample application and deployment stared to fail with the following message:
forge deploy --verbose

Error: Error thrown in the snapshot context.
App code snapshot error: Snapshot error occurred: Error: Environment variable config error
Learn more about the snapshot context at
    at ArtifactDeployer.handleErrorEvent (/usr/lib/node_modules/@forge/cli/out/deploy/deployer/deployer.js:127:23)
    at ArtifactDeployer.pollAndCheckEvents (/usr/lib/node_modules/@forge/cli/out/deploy/deployer/deployer.js:61:18)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async ArtifactDeployer.monitorDeployment (/usr/lib/node_modules/@forge/cli/out/deploy/deployer/deployer.js:72:28)
    at async ArtifactDeployer.deploy (/usr/lib/node_modules/@forge/cli/out/deploy/deployer/deployer.js:36:9)
    at async PackageUploadDeployCommand.execute (/usr/lib/node_modules/@forge/cli/out/deploy/package-upload-deploy.js:23:9)
    at async CommandLineUI.displayProgress (/usr/lib/node_modules/@forge/cli/node_modules/@forge/cli-shared/out/ui/command-line-ui.js:45:28)
    at async DeployView.reportDeploymentProgress (/usr/lib/node_modules/@forge/cli/out/command-line/view/deploy-view.js:50:24)
    at async (/usr/lib/node_modules/@forge/cli/out/command-line/controller/deploy-controller.js:120:27)
    at async Command.actionProcessor (/usr/lib/node_modules/@forge/cli/out/command-line/command.js:78:32)

Any hint?

At deployment time Forge evaluates all global expressions in your app and imported npm modules’ global expressions. Check global expressions in your app. If you can’t find the problem there, remove npm imports one by one. I couldn’t find an easer way to solve this. You can also disable snapshots in manifest.yml but this may just delay the problem to runtime.

Thanks for this response. I couldn’t get that. I thought it was because of env issue. LMK how I can check and remove that. Any example plz?

Any clue here plz?

cc @ibuchanan