{"record":{"id":"2c305e379bc7d4d2","repo":"windmill-labs/windmill","slug":"frontend-file-target-filepath-not-found-in-ap","errorCode":null,"errorMessage":"Frontend file \"${target.filePath}\" not found in app \"${args.path}\".","messagePattern":"Frontend file \"(.+?)\" not found in app \"(.+?)\"\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"frontend/src/lib/components/copilot/chat/global/core.ts","lineNumber":5619,"sourceCode":"\t\tfile_path: string\n\t\toffset?: number\n\t\tlimit?: number\n\t},\n\tctx: WriteDraftCtx\n): Promise<string> {\n\tconst { workspace, toolId, toolCallbacks } = ctx\n\tconst target = resolveAppFileTarget(args.file_path)\n\ttoolCallbacks.setToolStatus(toolId, {\n\t\tcontent: `Reading ${target.filePath} from app \"${args.path}\"...`\n\t})\n\n\tconst value = await loadAppValueForRead(args.path, workspace)\n\n\tlet content: string\n\tif (target.kind === 'frontend') {\n\t\tconst frontend = value.files[target.filePath]\n\t\tif (frontend === undefined) {\n\t\t\tthrow new Error(`Frontend file \"${target.filePath}\" not found in app \"${args.path}\".`)\n\t\t}\n\t\tcontent = frontend\n\t} else {\n\t\tcontent = getInlineRunnableContent(value, target, args.path).content\n\t}\n\n\tconst slice = sliceAppFileForRead(content, args.offset, args.limit)\n\n\ttoolCallbacks.setToolStatus(toolId, { content: `Read ${target.filePath}` })\n\treturn formatAppFileReadResult(slice)\n}\n\n// search_app caps: a single query must stay sparse and cheap even when it hits a\n// minified bundle or a 5k-line data module. Per-line and total-output caps bound\n// the result the same way read_app_file's char budget bounds one file read; the\n// match cap keeps a broad query from flooding context instead of locating it.\nconst SEARCH_APP_DEFAULT_MAX_MATCHES = 100\nconst SEARCH_APP_MAX_MATCHES_CEILING = 200","sourceCodeStart":5601,"sourceCodeEnd":5637,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/lib/components/copilot/chat/global/core.ts#L5601-L5637","documentation":"When reading an app's content, frontend files are looked up by key in the app value's `files` map. If the requested filePath key is absent, the app value has no such frontend file and the tool throws. Inline runnable targets take a different path (getInlineRunnableContent) and do not produce this error.","triggerScenarios":"Calling the read-app-content tool with a target of kind 'frontend' where value.files[target.filePath] === undefined for app args.path (draft or deployed).","commonSituations":"Typo'd or wrong-cased file path; requesting a file that only exists in a different app; the file was deleted or never created in the app draft; assuming a default file name that the template did not generate.","solutions":["List the app's actual files first (read the app structure) and retry with an exact existing filePath key.","Check path spelling and case against the app's file map.","Create the missing file with write_app_file if it should exist."],"exampleFix":"// before\nreadAppFile({ path: 'f/myapp', filePath: 'src/App.svelte' }) // app uses flat layout\n// after\nreadAppFile({ path: 'f/myapp', filePath: 'App.svelte' })","handlingStrategy":"validation","validationCode":"const value = await loadAppValueForRead(args.path, workspace)\nif (!(target.filePath in value.files)) {\n  console.warn('available:', Object.keys(value.files))\n}","typeGuard":"function hasFrontendFile(value: AppValue, filePath: string): boolean {\n  return Object.prototype.hasOwnProperty.call(value.files ?? {}, filePath)\n}","tryCatchPattern":"try {\n  content = await readAppFile(args)\n} catch (e) {\n  if (e.message.startsWith('Frontend file')) {\n    const value = await loadAppValueForRead(args.path, workspace)\n    // retry with an exact key from Object.keys(value.files)\n  } else throw e\n}","preventionTips":["List the app's file keys before reading; copy paths exactly (case-sensitive).","Do not assume template default file names — inspect the app value.","Create missing files with write_app_file before reading them."],"tags":["apps","file-not-found","validation"],"backgroundTag":"file-not-found","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"}