Skip to content

version-compatibility issue between lark and lark-js #48

@dima

Description

@dima

There's a version-compatibility issue between lark and lark-js.

lark-js 0.1.4 is the newest available release, but it only works reliably with lark 1.0.0. Newer lark versions serialize parser options like strict and ordered_sets, while the JS runtime embedded by lark-js doesn’t understand them and throws:

  • Unknown options: strict,ordered_sets
  • and with even newer lark, also cache_grammar

Why this happens

The standalone parser generator writes a serialized options object into generated parser.js.

With newer lark, that options object includes fields such as:

  • strict
  • ordered_sets
  • cache_grammar

But the JS-side LarkOptions implementation bundled by lark-js 0.1.4 does not accept those fields, so loading the generated parser fails before parsing even starts.

So the short version is:

  • Python side got newer
  • JS side stayed older
  • generated parser became self-incompatible

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions