{"record":{"id":"75e05bb567b85d18","repo":"FlowiseAI/Flowise","slug":"invalid-object-syntax-inside-array","errorCode":null,"errorMessage":"Invalid object syntax inside array","messagePattern":"Invalid object syntax inside array","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/src/secureZodParser.ts","lineNumber":249,"sourceCode":"\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)\n            }\n\n            return {\n                isArrayOfObjects: true,\n                objectSchema: objectProperties\n            }\n        }\n\n        // Handle simple arrays (e.g., z.array(z.string()))\n        const innerType = this.parseZodType(arrayContent)","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/src/secureZodParser.ts#L231-L267","documentation":"Inside parseArray, when the array content starts with 'z.object(' but its body does not match /z\\.object\\(\\s*\\{([\\s\\S]*)\\}\\s*\\)/ (missing or malformed '{}'), this throws. It is the array counterpart of error 611: an array whose element type is an object literal without a valid brace body.","triggerScenarios":"'z.array(z.object())' or 'z.array(z.object(null))'.","commonSituations":"Defining an array of empty objects without braces; referencing a variable as the element object.","solutions":["Give the array's element object a brace-wrapped body, e.g. 'z.array(z.object({ id: z.string() }))'."],"exampleFix":"// before\n'z.object({ items: z.array(z.object()) })'\n\n// after\n'z.object({ items: z.array(z.object({ id: z.string() })) })'","handlingStrategy":"validation","validationCode":"const validObjectInArray = (v: string): boolean =>\n  /z\\.array\\(\\s*z\\.object\\(\\s*\\{[\\s\\S]*\\}\\s*\\)\\s*\\)$/.test(v)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Give an array's element object a brace body: z.array(z.object({...})).","Avoid z.array(z.object())."],"tags":["zod","schema","parsing","array","nested-object"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}