Skip to content

Fix helpful "Incompatible language version" error not showing #243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pixilation
Copy link

When using parser.setLanguage(myLang), the UnwrapLanguage function checks that the ABI version is compatible.

If the language is not compatible, an error like this is created:

RangeError: Incompatible language version. Compatible range: 13 - 14. Got: 15`
    at Parser.setLanguage

Due to a refactoring of the exceptions, this RangeError is created but not thrown. The UnwrapLanguage function returns a null pointer instead.

This leads to cryptic errors elsewhere, such as:

TypeError: Cannot read properties of undefined (reading 'length')
    at initializeLanguageNodeClasses
    at Parser.setLanguage

This is resulting in issues being raised in other repos, such as tree-sitter/tree-sitter#4234.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant