{"record":{"id":"4b3e7a37bf6182e2","repo":"FlowiseAI/Flowise","slug":"invalid-array-syntax","errorCode":null,"errorMessage":"Invalid array syntax","messagePattern":"Invalid array syntax","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/src/secureZodParser.ts","lineNumber":239,"sourceCode":"                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        }\n\n        const arrayContent = arrayContentMatch[1].trim()\n\n        // Parse the object inside the array\n        if (arrayContent.startsWith('z.object(')) {\n            // Extract object content\n            const objectMatch = arrayContent.match(/z\\.object\\(\\s*\\{([\\s\\S]*)\\}\\s*\\)/)\n            if (!objectMatch) {\n                throw new Error('Invalid object syntax inside array')\n            }\n\n            const objectContent = objectMatch[1]\n            const objectProperties = this.parseObjectProperties(objectContent)\n\n            // Validate each property in the nested object\n            for (const propValue of Object.values(objectProperties)) {\n                this.validateTypeInfo(propValue)","sourceCodeStart":221,"sourceCodeEnd":257,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/src/secureZodParser.ts#L221-L257","documentation":"parseArray requires the input to match /z\\.array\\(\\s*([\\s\\S]*)\\s*\\)$/ — the string must END with ')' after the array content. This throws when the array call is unbalanced or does not terminate with a closing paren, e.g. 'z.array(z.string()' (missing close) or content that swallows the terminator.","triggerScenarios":"'z.array(z.string()' (missing ')'), 'z.array(z.string()]' (wrong bracket), or any z.array whose final ')' is missing.","commonSituations":"Truncating a schema string; nested arrays where parens are miscounted.","solutions":["Balance the parentheses so the array call ends with ')'.","For nested arrays, count opening and closing parens to ensure they match."],"exampleFix":"// before\n'z.object({ tags: z.array(z.string() })'\n\n// after\n'z.object({ tags: z.array(z.string()) })'","handlingStrategy":"validation","validationCode":"const validArrayCall = (v: string): boolean => /z\\.array\\(\\s*[\\s\\S]*\\s*\\)$/.test(v)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Balance parentheses so the array call ends with ')'.","Count parens for nested arrays to avoid swallowing the terminator."],"tags":["zod","schema","parsing","array"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}