{"record":{"id":"d17f949c550675bf","repo":"FlowiseAI/Flowise","slug":"invalid-json-in-the-additional-configuration-ex-d17f94","errorCode":null,"errorMessage":"Invalid JSON in the Additional Configuration: ${exception}","messagePattern":"Invalid JSON in the Additional Configuration: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/vectorstores/Postgres/driver/TypeORM.ts","lineNumber":29,"sourceCode":"type TypeORMAddDocumentOptions = {\n    ids?: string[]\n}\n\nexport class TypeORMDriver extends VectorStoreDriver {\n    protected _postgresConnectionOptions: DataSourceOptions\n\n    protected async getPostgresConnectionOptions() {\n        if (!this._postgresConnectionOptions) {\n            const { user, password } = await this.getCredentials()\n            const additionalConfig = this.nodeData.inputs?.additionalConfig as string\n\n            let additionalConfiguration = {}\n\n            if (additionalConfig) {\n                try {\n                    additionalConfiguration = typeof additionalConfig === 'object' ? additionalConfig : JSON.parse(additionalConfig)\n                } catch (exception) {\n                    throw new Error('Invalid JSON in the Additional Configuration: ' + exception)\n                }\n                additionalConfiguration = sanitizeDataSourceOptions(additionalConfiguration)\n            }\n\n            this._postgresConnectionOptions = {\n                ...additionalConfiguration,\n                type: 'postgres',\n                host: this.getHost(),\n                port: this.getPort(),\n                ssl: this.getSSL(),\n                username: user, // Required by TypeORMVectorStore\n                user: user, // Required by Pool in similaritySearchVectorWithScore\n                password: password,\n                database: this.getDatabase()\n            } as DataSourceOptions\n\n            // Prevent using default MySQL port, otherwise will throw uncaught error and crashing the app\n            if (this.getHost() === '3006') {","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/vectorstores/Postgres/driver/TypeORM.ts#L11-L47","documentation":"Thrown by the TypeORM Postgres driver while parsing the node's `additionalConfig` input as JSON. Identical mechanics to the PGVector variant: a non-object string value is run through `JSON.parse`, and on failure the parse exception is wrapped into this message. The result feeds TypeORM `DataSourceOptions`.","triggerScenarios":"Malformed JSON in the Additional Configuration field (trailing commas, single quotes, unquoted keys, comments). The TypeORM driver additionally requires the parsed object to be compatible with `DataSourceOptions`.","commonSituations":"Hand-edited JSON with JS-object syntax; copy-paste from TypeScript config with comments; stale template tokens; rich-text invisible characters.","solutions":["Validate the value with a JSON linter before saving.","Use strict JSON (double quotes, no trailing commas, no comments).","Leave the field empty if unused.","Pass an object programmatically to bypass JSON.parse."],"exampleFix":"// before — invalid\n\"{ schema: 'public', }\"\n// after — valid\n{\"schema\":\"public\"}","handlingStrategy":"validation","validationCode":"function parseAdditionalConfig(raw: unknown): Record<string, unknown> {\n  if (raw === undefined || raw === null || raw === '') return {}\n  if (typeof raw === 'object') return raw as Record<string, unknown>\n  try {\n    return JSON.parse(raw)\n  } catch {\n    throw new Error('additionalConfig is not valid JSON')\n  }\n}","typeGuard":"function isJsonString(v: string): boolean {\n  try { JSON.parse(v); return true } catch { return false }\n}","tryCatchPattern":"const additionalConfiguration = parseAdditionalConfig(additionalConfig)","preventionTips":["Lint the Additional Configuration field as strict JSON.","Avoid JS-object syntax (unquoted keys, trailing commas, comments).","Leave empty when unused.","Pass an object programmatically to bypass JSON.parse."],"tags":["postgres","typeorm","config","json","validation"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}