cel-js icon indicating copy to clipboard operation
cel-js copied to clipboard

CelParseError: Given string is not a valid CEL expression: Redundant input, expecting EOF but found: m

Open jacobshirley opened this issue 6 months ago • 1 comments

Got a very strange error when running this:

evaluate('form.field == "admin"', { form: { field: 'admin' } })

Output:

CelParseError: Given string is not a valid CEL expression: Redundant input, expecting EOF but found: m

However, this below works fine (note the missing 'r')

evaluate('fom.field == "admin"', { fom: { field: 'admin' } })

This makes me think it's trying to interpret for as some kind of cel syntax.

jacobshirley avatar May 23 '25 08:05 jacobshirley

Hey @jacobshirley, your intuition was correct. for is among the ReservedIdentifiers and, as such, is wrongly found in the identifier. I have a fix, but it still breaks on an edge case. I should have a PR on Monday.

Jastrzebowski avatar May 23 '25 22:05 Jastrzebowski

Nice, thanks for reporting the bug and providing the fix. Already released 🙌

ChromeGG avatar May 24 '25 10:05 ChromeGG

Amazing, thanks for the quick fix!

jacobshirley avatar May 24 '25 12:05 jacobshirley