flippercloud/flipper · error · ArgumentError

#{value.inspect} cannot be converted to a set

Error message

#{value.inspect} cannot be converted to a set

What it means

Error "#{value.inspect} cannot be converted to a set" thrown in flippercloud/flipper.

Source

Thrown at lib/flipper/typecast.rb:72

        value.to_f
      end
    rescue NoMethodError
      raise ArgumentError, "#{value.inspect} cannot be converted to a number"
    end
    singleton_class.send(:alias_method, :to_percentage, :to_number)

    # Internal: Convert value to a set.
    #
    # Returns a Set representation of the value.
    # Raises ArgumentError if conversion is not possible.
    def self.to_set(value)
      return value if value.is_a?(Set)
      return Set.new if value.nil? || value.empty?

      if value.respond_to?(:to_set)
        value.to_set
      else
        raise ArgumentError, "#{value.inspect} cannot be converted to a set"
      end
    end

    # Internal: Convert value to a feature name usable as a feature key.
    # Removes invisible format/control characters (zero-width spaces,
    # joiners, BOM, etc.) that make visually identical but distinct names,
    # and trims unicode whitespace (e.g. non-breaking space) that
    # String#strip misses. Visible characters are left untouched.
    #
    # Returns a String.
    def self.to_feature_name(value)
      # U+2800 renders as a fixed-width blank but is not default-ignorable or whitespace.
      value.to_s
           .scrub('')
           .gsub(/[\p{Default_Ignorable_Code_Point}\p{Cc}\u2800]/, '')
           .gsub(/\A[[:space:]]+|[[:space:]]+\z/, '')
    end

View on GitHub (pinned to 1f86de3ec9)

Solutions

  1. Pass an Array, Set, or delimited String; other types cannot be converted to a Set
  2. Convert with Array(value) or value.split(',') before passing to Flipper
  3. Check the value type coming from your adapter or request params

When it happens

Trigger: Thrown at lib/flipper/typecast.rb:72 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of flippercloud/flipper@1f86de3ec9 (2026-08-23). Data as JSON: /api/errors/b76953f190d45146. Report an issue: GitHub.