{"record":{"id":"1a1403f21a807b3b","repo":"FlowiseAI/Flowise","slug":"unsupported-base-type-typeinfo-base","errorCode":null,"errorMessage":"Unsupported base type: ${typeInfo.base}","messagePattern":"Unsupported base type: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/src/secureZodParser.ts","lineNumber":620,"sourceCode":"            case 'number':\n                zodType = z.number()\n                break\n            case 'boolean':\n                zodType = z.boolean()\n                break\n            case 'date':\n                zodType = z.date()\n                break\n            case 'enum':\n                if (typeInfo.baseArgs && typeInfo.baseArgs[0] && Array.isArray(typeInfo.baseArgs[0])) {\n                    const enumValues = typeInfo.baseArgs[0] as [string, ...string[]]\n                    zodType = z.enum(enumValues)\n                } else {\n                    throw new Error('enum requires array of values')\n                }\n                break\n            default:\n                throw new Error(`Unsupported base type: ${typeInfo.base}`)\n        }\n\n        // Apply modifiers\n        zodType = this.applyModifiers(zodType, typeInfo.modifiers || [])\n\n        return zodType\n    }\n\n    private static applyModifiers(zodType: z.ZodTypeAny, modifiers: any[]): z.ZodTypeAny {\n        for (const modifier of modifiers) {\n            switch (modifier.name) {\n                case 'int':\n                    if (zodType._def?.typeName === 'ZodNumber') {\n                        zodType = (zodType as z.ZodNumber).int()\n                    }\n                    break\n                case 'max':\n                    if (modifier.args[0] !== undefined) {","sourceCodeStart":602,"sourceCodeEnd":638,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/src/secureZodParser.ts#L602-L638","documentation":"The default branch of buildZodSchema's switch, hit when the parsed base type is not one of the primitive cases the builder constructs (string, number, boolean, date, enum). Although the base already passed the ALLOWED_TYPES whitelist, only some whitelist entries are buildable as a base type; the rest (optional, max, min, describe, default, object, array) are modifier/container-only.","triggerScenarios":"A malformed schema where a modifier-only token or container token is parsed as the base, e.g. a field defined as `z.optional()`, `z.max(5)`, `z.default(\"x\")`, or a bare `z.object(...)`/`z.array(...)` that was not routed through its dedicated build path.","commonSituations":"Hand-writing a schema and leading a field with a modifier instead of a base type; a parser edge case where a nested container is misclassified as a primitive base.","solutions":["Lead every field with a primitive base type (`string`, `number`, `boolean`, `date`, or `enum([...])`) and chain modifiers after it.","Use `z.string().optional()` rather than `z.optional()`.","Re-read the schema string and confirm the first token of each field is a buildable base type."],"exampleFix":"// before\nconst schema = \"z.object({ name: z.optional() })\"\n// after\nconst schema = \"z.object({ name: z.string().optional() })\"","handlingStrategy":"validation","validationCode":"const BASE_TYPES = ['string','number','boolean','date','enum']\nfunction validateFieldBases(schemaStr: string): string[] {\n  const issues: string[] = []\n  for (const m of schemaStr.matchAll(/:\\s*z\\.([a-zA-Z_]\\w*)/g)) {\n    if (!BASE_TYPES.includes(m[1])) issues.push(`field base not buildable: ${m[1]}`)\n  }\n  return issues\n}","typeGuard":"function isBuildableBase(base: string): boolean {\n  return ['string','number','boolean','date','enum'].includes(base)\n}","tryCatchPattern":"try {\n  const schema = SecureZodSchemaParser.parseZodSchema(schemaStr)\n} catch (e) {\n  if (/Unsupported base type/.test(e.message)) {\n    // ensure each field starts with a primitive base type\n  }\n  throw e\n}","preventionTips":["Lead every field with a primitive base type (string/number/boolean/date/enum).","Never use a modifier name (optional/max/min/default/describe) as the leading token.","Review generated schemas field-by-field."],"tags":["zod","schema","validation"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}