{"record":{"id":"56344303ad5fb68d","repo":"FlowiseAI/Flowise","slug":"method-method-is-not-available-on-the-rpc-objec","errorCode":null,"errorMessage":"Method ${method} is not available on the RPC object","messagePattern":"Method (.+?) is not available on the RPC object","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/vectorstores/Supabase/filterParser.ts","lineNumber":190,"sourceCode":"            // Simple array parsing - just split by comma and parse each element\n            return arrayContent.split(',').map((item) => this.parseArgument(item.trim()))\n        }\n\n        // For everything else, treat as string (but validate it doesn't contain dangerous characters)\n        if (arg.includes('require') || arg.includes('process') || arg.includes('eval') || arg.includes('Function')) {\n            throw new Error(`Potentially dangerous argument: ${arg}`)\n        }\n\n        return arg\n    }\n\n    private static buildFilterFunction(chain: Array<{ method: string; args: any[] }>): (rpc: any) => any {\n        return (rpc: any) => {\n            let result = rpc\n\n            for (const { method, args } of chain) {\n                if (typeof result[method] !== 'function') {\n                    throw new Error(`Method ${method} is not available on the RPC object`)\n                }\n\n                try {\n                    result = result[method](...args)\n                } catch (error) {\n                    throw new Error(`Failed to call ${method}: ${error.message}`)\n                }\n            }\n\n            return result\n        }\n    }\n}\n","sourceCodeStart":172,"sourceCodeEnd":204,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/vectorstores/Supabase/filterParser.ts#L172-L204","documentation":"The built filter function, when invoked on an RPC object, checks `typeof result[method] !== 'function'` before each call. If an allowed-method name is not actually present as a function on the runtime RPC/builder object, it throws 'Method ${method} is not available on the RPC object'. This is a runtime guard complementing the static allowlist.","triggerScenarios":"The Supabase client/builder shape changed (method removed or renamed in a newer version); the filter is applied to an object that is not a PostgREST builder (e.g. a raw RPC return value); version drift between the parser's assumptions and the installed @supabase/postgrest-js.","commonSituations":"Upgrading @supabase/supabase-js where a builder method was renamed/removed; applying the filter function to the wrong object type; `maybeSingle`/`single` ordering on a non-chainable result.","solutions":["Confirm the installed @supabase version actually exposes the method on the builder at runtime.","Apply the filter function to the correct chainable object (e.g. the return of `.rpc(name)`), not a final result.","Pin or upgrade the Supabase client to a version whose builder matches the parser's allowlist.","Reorder chain so terminal methods (single/maybeSingle) come last."],"exampleFix":"// before: const fn = FilterParser.parseFilterString('single()'); fn(rpcResult)  // result lacks .single\n// after: const fn = FilterParser.parseFilterString('filter(\"a\",\"eq\",1).single()'); fn(client.rpc('match'))","handlingStrategy":"type-guard","validationCode":"function assertBuilderHasMethod(builder: any, method: string) {\n  if (typeof builder?.[method] !== 'function') throw new Error(`Method '${method}' missing on builder; check @supabase version`)\n}","typeGuard":"function isChainableBuilder(v: any): boolean { return v != null && ['filter','order','limit'].some(m => typeof v[m] === 'function') }","tryCatchPattern":"try { result = result[method](...args) } catch (e) { /* handled by 557 */ }","preventionTips":["Pin @supabase/supabase-js to a version whose builder matches the allowlist.","Apply the filter function to the chainable builder, not a final result.","Order terminal methods (single/maybeSingle) last.","Smoke-test builder method presence at startup."],"tags":["supabase","filter-parser","runtime","version-drift","typescript"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}