{"record":{"id":"a3ad6fc1f0f4f5a3","repo":"FlowiseAI/Flowise","slug":"invalid-modifier-part","errorCode":null,"errorMessage":"Invalid modifier: ${part}","messagePattern":"Invalid modifier: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/src/secureZodParser.ts","lineNumber":222,"sourceCode":"\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\n                type.modifiers.push({ name: modName, args: modArgs })\n            }\n        }\n\n        return type\n    }\n\n    private static parseArray(typeStr: string): any {\n        // Extract the content inside array()\n        const arrayContentMatch = typeStr.match(/z\\.array\\(\\s*([\\s\\S]*)\\s*\\)$/)\n        if (!arrayContentMatch) {\n            throw new Error('Invalid array syntax')\n        }","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/src/secureZodParser.ts#L204-L240","documentation":"In parseZodType, every modifier segment (the 3rd and later dotted parts of a chained call) must match /^(\\w+)(\\(.*\\))?$/. This throws on malformed modifier syntax such as a trailing dot producing an empty segment ('z.string().'), an unclosed paren ('z.string().max(500'), or symbols inside a modifier name.","triggerScenarios":"'z.string().' (trailing dot), 'z.string().max(500' (unclosed paren), 'z.string().@max(500)'.","commonSituations":"Manual editing that drops a closing ')'; concatenating modifier strings programmatically and leaving a dangling '.'.","solutions":["Ensure each modifier is 'name' or 'name(args)' with balanced parentheses and no stray characters.","Remove trailing dots; every '.' must be followed by a modifier identifier."],"exampleFix":"// before\n'z.object({ n: z.string().max(500 })'\n\n// after\n'z.object({ n: z.string().max(500) })'","handlingStrategy":"validation","validationCode":"function modifiersWellFormed(value: string): boolean {\n  const parts = value.split('.')\n  return parts.slice(2).every((p) => /^\\w+(\\(.*\\))?$/.test(p.trim()))\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure every modifier is 'name' or 'name(args)' with balanced parens.","Avoid trailing dots; every '.' must be followed by a modifier identifier."],"tags":["zod","schema","parsing","modifier"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}