{"record":{"id":"8ff349df51d4ef88","repo":"windmill-labs/windmill","slug":"failed-to-infer-schema-for-runnableid-schema","errorCode":null,"errorMessage":"Failed to infer schema for ${runnableId}: ${schemaError.message}","messagePattern":"Failed to infer schema for (.+?): (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/commands/app/app_metadata.ts","lineNumber":967,"sourceCode":"  }\n\n  const remotePath = appFolder.replaceAll(SEP, \"/\");\n\n  try {\n    const schemaResult = await inferSchema(\n      language as ScriptLanguage,\n      content,\n      currentSchema,\n      `${remotePath}/${runnableId}`\n    );\n\n    log.info(colors.green(`  Inferred schema for ${runnableId}`));\n    return {\n      runnableId: runnableId,\n      schema: schemaResult.schema,\n    };\n  } catch (schemaError: any) {\n    log.warn(\n      colors.yellow(\n        `Failed to infer schema for ${runnableId}: ${schemaError.message}`\n      )\n    );\n    return undefined;\n  }\n}\n\n/**\n * Infers schemas for every inline runnable code file in the app's backend\n * folder. Used at `wmill app dev` startup so the initial wmill.d.ts has typed\n * args without waiting for a file change to trigger the watcher.\n *\n * Returns a map of runnableId -> schema. Files that fail inference or are not\n * inline runnables are silently skipped - their entries will fall back to\n * `args: {}` in the generated d.ts.\n */\nexport async function inferAllInlineSchemas(","sourceCodeStart":949,"sourceCodeEnd":985,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/app/app_metadata.ts#L949-L985","documentation":"Wrap-around catch in inferRunnableSchemaFromFile: the language-specific inferSchema call (over the runnable's content and current schema) threw — e.g. unparseable code, unsupported construct, or a parser crash. Logged as a warning and returns undefined, so only this runnable loses schema inference.","triggerScenarios":"Thrown at cli/src/commands/app/app_metadata.ts:967 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the syntax error in the runnable's code so the parser can infer the schema","Provide the schema explicitly in the runnable YAML to bypass inference","Check the inferred error message from the language parser for the offending code"],"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"}