{"record":{"id":"8582ad964db8dc28","repo":"windmill-labs/windmill","slug":"error-reading-mocked-api-file-at-path","errorCode":null,"errorMessage":"Error reading mocked API file at path","messagePattern":"Error reading mocked API file at path","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"typescript-client/client.ts","lineNumber":1531,"sourceCode":"  }\n\n  try {\n    const fs = await import(\"node:fs/promises\");\n    const file = await fs.readFile(mockedPath, \"utf-8\");\n    try {\n      mockedApi = JSON.parse(file) as MockedApi;\n      if (!mockedApi.variables) {\n        mockedApi.variables = {};\n      }\n      if (!mockedApi.resources) {\n        mockedApi.resources = {};\n      }\n      return mockedApi;\n    } catch {\n      console.warn(\"Error parsing mocked API file at path\", mockedPath);\n    }\n  } catch {\n    console.warn(\"Error reading mocked API file at path\", mockedPath);\n  }\n  if (!mockedApi) {\n    console.warn(\n      \"No mocked API file path provided at env variable WM_MOCKED_API_FILE. Using empty mocked API.\"\n    );\n    mockedApi = {\n      variables: {},\n      resources: {},\n    };\n    return mockedApi;\n  }\n}\n\ninterface MockedApi {\n  variables: Record<string, string>;\n  resources: Record<string, any>;\n}\n","sourceCodeStart":1513,"sourceCodeEnd":1549,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/typescript-client/client.ts#L1513-L1549","documentation":"Degrading warning while loading the mocked API in the TS client: fs.readFile threw on the path in WM_MOCKED_API_FILE (file missing or unreadable). The client falls through to the empty/no-mock path, so variables/resources lookups won't be mocked.","triggerScenarios":"Thrown at typescript-client/client.ts:1531 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the WM_MOCKED_API_FILE path is absolute-or-resolvable and exists","Fix file permissions for the running process","Unset the variable if mocking is no longer intended"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}