FlowiseAI/Flowise · error · Error

No valid filter methods found

Error message

No valid filter methods found

What it means

After tokenizing, if the parsed chain is empty the parser throws 'No valid filter methods found'. This means no method call matched the method pattern, so there is nothing safe to apply to the RPC. It guards against no-op filter strings being turned into a pass-through function.

Source

Thrown at packages/components/nodes/vectorstores/Supabase/filterParser.ts:96

                throw new Error(`Disallowed method: ${method}`)
            }

            // Parse arguments safely
            const args = this.parseArguments(argsString)

            // Additional validation for filter method
            if (method === 'filter' && args.length >= 2) {
                const operator = args[1]
                if (typeof operator === 'string' && !this.ALLOWED_OPERATORS.includes(operator)) {
                    throw new Error(`Disallowed filter operator: ${operator}`)
                }
            }

            chain.push({ method, args })
        }

        if (chain.length === 0) {
            throw new Error('No valid filter methods found')
        }

        return chain
    }

    private static parseArguments(argsString: string): any[] {
        if (!argsString.trim()) {
            return []
        }

        const args: any[] = []
        let current = ''
        let inString = false
        let stringChar = ''
        let depth = 0

        for (let i = 0; i < argsString.length; i++) {
            const char = argsString[i]

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Provide at least one allowed method call, e.g. `filter("col","eq",value)`.
  2. If an empty filter is valid for your flow, short-circuit before calling parseFilterString (skip filtering).
  3. Strip comments/semicolons and confirm the remaining string contains a method call.
  4. Validate non-empty after cleaning before parsing.

Example fix

// before: parseFilterString('')  -> No valid filter methods found
// after: if (!raw.trim()) return (rpc) => rpc  // treat empty as no-op
Defensive patterns

Strategy: validation

Validate before calling

function ensureNonEmptyFilter(raw: string): string {
  const cleaned = raw.replace(/\/\/.*$/gm,'').replace(/\/\*[\s\S]*?\*\//g,'').replace(/\s+/g,' ').trim().replace(/;$/,'').trim()
  if (!cleaned || !/\.?\w+\s*\(/.test(cleaned)) throw new Error('Filter must contain at least one method call')
  return cleaned
}

Type guard

function hasMethodCall(s: string): boolean { return /\.?\w+\s*\([^)]*\)/.test(s) }

Try / catch

null

Prevention

When it happens

Trigger: Empty or whitespace-only filter string; a string with only comments; a string that is just a literal/number with no `.method(...)` calls; malformed syntax the regex cannot tokenize (e.g. missing parentheses).

Common situations: Empty chatflow input submitted as a filter; user enters just a column name or raw SQL with no method chain; trailing content after a cleaned comment leaves no callable.

Related errors


AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12). Data as JSON: /api/errors/8afbaa07a5a36692. Report an issue: GitHub.