{"record":{"id":"a0dad51c907f50c5","repo":"windmill-labs/windmill","slug":"error-reading-inline-path-path-error","errorCode":null,"errorMessage":"Error reading inline path: ${path}, ${error}","messagePattern":"Error reading inline path: (.+?), (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli/src/utils/utils.ts","lineNumber":183,"sourceCode":"  if (content.charCodeAt(0) === 0xfeff) {\n    return content.slice(1);\n  }\n  return content;\n}\n\nexport async function readTextFile(path: string | URL): Promise<string> {\n  return decodeBufferAsUtf8(await readFile(path), path);\n}\n\nexport function readTextFileSync(path: string | URL): string {\n  return decodeBufferAsUtf8(readFileSync(path), path);\n}\n\nexport function readInlinePathSync(path: string): string {\n  try {\n    return readTextFileSync(path.replaceAll(\"/\", SEP));\n  } catch (error) {\n    log.warn(`Error reading inline path: ${path}, ${error}`);\n    return \"\";\n  }\n}\n\nexport function sleep(ms: number) {\n  return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\nexport function isFileResource(path: string): boolean {\n  const splitPath = path.split(\".\");\n\n  // Check for pattern: *.resource.file.* (handles both base and branch-specific)\n  return (\n    splitPath.length >= 4 &&\n    splitPath[splitPath.length - 3] == \"resource\" &&\n    splitPath[splitPath.length - 2] == \"file\"\n  );\n}","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/utils/utils.ts#L165-L201","documentation":"Windmill YAML/JSON configs can reference script content inline via `!inline <path>` directives. readInlinePathSync resolves such a path on disk; if the file cannot be read (missing, permission denied, wrong path), it logs this warning and returns an empty string, letting the caller proceed with empty content rather than crashing.","triggerScenarios":"A config file contains `!inline ./scripts/foo.ts` but the file does not exist at that relative path, is unreadable, or the path separator handling fails on the current OS; also used by replaceInlineScripts, resolveInlineContent and replaceLock when processing such references.","commonSituations":"Typos in the inline path; committing configs but not the referenced script files; running the CLI from a different working directory so relative paths break; case-sensitivity mismatches when moving between macOS and Linux CI.","solutions":["Fix the path in the config so it matches the actual file location relative to the CLI working directory.","Run the command from the app/flow root directory so relative !inline paths resolve.","Verify the referenced file exists and is readable (`ls`, permissions).","If the file should have been generated, generate it before running the sync/push command."],"exampleFix":"// before\nentrypoint: '!inline ./script/Scritp.ts'   # typo, file unreadable\n// after\nentrypoint: '!inline ./script/Script.ts'","handlingStrategy":"validation","validationCode":"import { existsSync } from 'node:fs';\n// resolve every !inline path in your config before running the CLI\nconst path = './script/Script.ts';\nif (!existsSync(path)) throw new Error(`inline path does not exist: ${path}`);","typeGuard":"null","tryCatchPattern":"const content = readInlinePathSync(path);\nif (content === '') {\n  throw new Error(`inline path '${path}' could not be read — aborting before generating empty output`);\n}","preventionTips":["Always run wmill commands from the app/flow root so relative paths resolve.","Add a CI check that every `!inline` path in committed configs exists in the repo.","Watch for 'Error reading inline path' warnings in output — empty content propagates silently.","Beware case-sensitivity differences between macOS and Linux filesystems."],"tags":["cli","filesystem","inline-scripts","path"],"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"}