{"record":{"id":"1a356f40b9916367","repo":"Kong/insomnia","slug":"vault-is-disabled-in-script","errorCode":null,"errorMessage":"Vault is disabled in script","messagePattern":"Vault is disabled in script","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/insomnia-scripting-environment/src/objects/environments.ts","lineNumber":405,"sourceCode":" * ```\n */\nexport class Vault extends Environment {\n  /**\n   * Constructs an instance of the Vault class.\n   *\n   * @param name - The name associated with the environment.\n   * @param jsonObject - An optional JSON object representing the vault's data.\n   * @param enableVaultInScripts - A boolean flag indicating whether vault access is enabled in scripts.\n   *\n   * @throws Will throw an error if `enableVaultInScripts` is `false` and an attempt is made to get or set a property.\n   */\n  constructor(name: string, jsonObject: object | undefined, enableVaultInScripts: boolean) {\n    super(name, jsonObject);\n    return new Proxy(this, {\n      // throw error on get or set method call if enableVaultInScripts is false\n      get: (target, prop, receiver) => {\n        if (!enableVaultInScripts) {\n          throw new Error('Vault is disabled in script');\n        }\n        return Reflect.get(target, prop, receiver);\n      },\n      set: (target, prop, value, receiver) => {\n        if (!enableVaultInScripts) {\n          throw new Error('Vault is disabled in script');\n        }\n        return Reflect.set(target, prop, value, receiver);\n      },\n    });\n  }\n\n  /** @ignore */\n  unset = () => {\n    throw new Error('Vault can not be unset in script');\n  };\n\n  /** @ignore */","sourceCodeStart":387,"sourceCodeEnd":423,"githubUrl":"https://github.com/Kong/insomnia/blob/d9bb2b0142600f21309832daea3317942d285984/packages/insomnia-scripting-environment/src/objects/environments.ts#L387-L423","documentation":"Error \"Vault is disabled in script\" thrown in Kong/insomnia.","triggerScenarios":"Thrown at packages/insomnia-scripting-environment/src/objects/environments.ts:405 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d9bb2b0142600f21309832daea3317942d285984","analyzedAt":"2026-08-26T18:04:05.187Z","schemaVersion":2},"datasetVersion":"2026-08-26T21:11:00.512Z"}