FlowiseAI/Flowise · error · Error
Invalid base type: ${part}
Error message
Invalid base type: ${part} What it means
The second dotted segment (the base type) must match /^(\w+)(\(.*\))?$/. This throws when the base segment contains characters outside \w or has malformed parentheses — e.g. 'z.123', 'z.@string', 'z.str ing', or a base with unbalanced parens like 'z.string('.
Source
Thrown at packages/components/src/secureZodParser.ts:209
// Handle chained methods like z.string().max(500).optional()
const parts = typeStr.split('.')
for (let i = 0; i < parts.length; i++) {
const part = parts[i].trim()
if (i === 0) {
// First part should be 'z'
if (part !== 'z') {
throw new Error(`Expected 'z' but got '${part}'`)
}
continue
}
if (i === 1) {
// Second part is the base type
const baseMatch = part.match(/^(\w+)(\(.*\))?$/)
if (!baseMatch) {
throw new Error(`Invalid base type: ${part}`)
}
type.base = baseMatch[1]
if (baseMatch[2]) {
// Parse arguments for base type (e.g., enum values)
const args = this.parseArguments(baseMatch[2])
type.baseArgs = args
}
} else {
// Subsequent parts are modifiers
const modMatch = part.match(/^(\w+)(\(.*\))?$/)
if (!modMatch) {
throw new Error(`Invalid modifier: ${part}`)
}
const modName = modMatch[1]
const modArgs = modMatch[2] ? this.parseArguments(modMatch[2]) : []
View on GitHub (pinned to abe4a8601a)
Solutions
- Use a valid identifier base type composed of [A-Za-z0-9_].
- Ensure any base-type call has balanced parentheses, e.g. 'z.string()' or 'z.enum(["a","b"])'.
Example fix
// before
'z.object({ n: z.123 })' // or 'z.object({ n: z.string( })'
// after
'z.object({ n: z.string() })' Defensive patterns
Strategy: validation
Validate before calling
const validBaseSegment = (part: string): boolean => /^(\w+)(\(.*\))?$/.test(part)
Prevention
- Keep base type names as identifiers ([A-Za-z0-9_]).
- Ensure any base-type call has balanced parentheses.
When it happens
Trigger: Typo with digits/symbols at the start of the type name ('z.123'); whitespace inside the segment; an unclosed '(' in the base call.
Common situations: Hand-typing a schema and inserting a stray character; editor auto-complete inserting a broken snippet.
Related errors
- Failed to parse Zod schema: ${error.message}
- Schema must start with z.object()
- Invalid z.object() syntax
- Invalid object syntax
- Expected 'z' but got '${part}'
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/0419bba53727118c.
Report an issue: GitHub.