{"record":{"id":"0419bba53727118c","repo":"FlowiseAI/Flowise","slug":"invalid-base-type-part","errorCode":null,"errorMessage":"Invalid base type: ${part}","messagePattern":"Invalid base type: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/src/secureZodParser.ts","lineNumber":209,"sourceCode":"        // Handle chained methods like z.string().max(500).optional()\n        const parts = typeStr.split('.')\n\n        for (let i = 0; i < parts.length; i++) {\n            const part = parts[i].trim()\n\n            if (i === 0) {\n                // First part should be 'z'\n                if (part !== 'z') {\n                    throw new Error(`Expected 'z' but got '${part}'`)\n                }\n                continue\n            }\n\n            if (i === 1) {\n                // Second part is the base type\n                const baseMatch = part.match(/^(\\w+)(\\(.*\\))?$/)\n                if (!baseMatch) {\n                    throw new Error(`Invalid base type: ${part}`)\n                }\n\n                type.base = baseMatch[1]\n                if (baseMatch[2]) {\n                    // Parse arguments for base type (e.g., enum values)\n                    const args = this.parseArguments(baseMatch[2])\n                    type.baseArgs = args\n                }\n            } else {\n                // Subsequent parts are modifiers\n                const modMatch = part.match(/^(\\w+)(\\(.*\\))?$/)\n                if (!modMatch) {\n                    throw new Error(`Invalid modifier: ${part}`)\n                }\n\n                const modName = modMatch[1]\n                const modArgs = modMatch[2] ? this.parseArguments(modMatch[2]) : []\n","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/src/secureZodParser.ts#L191-L227","documentation":"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('.","triggerScenarios":"Typo with digits/symbols at the start of the type name ('z.123'); whitespace inside the segment; an unclosed '(' in the base call.","commonSituations":"Hand-typing a schema and inserting a stray character; editor auto-complete inserting a broken snippet.","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\"])'."],"exampleFix":"// before\n'z.object({ n: z.123 })'   // or 'z.object({ n: z.string( })'\n\n// after\n'z.object({ n: z.string() })'","handlingStrategy":"validation","validationCode":"const validBaseSegment = (part: string): boolean => /^(\\w+)(\\(.*\\))?$/.test(part)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep base type names as identifiers ([A-Za-z0-9_]).","Ensure any base-type call has balanced parentheses."],"tags":["zod","schema","parsing"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}