Skip to content

Conversation

marinaaisa
Copy link
Owner

Bug/issue #156714814, if applicable:

Summary

tree-sitter-vue [1] is not compatible with Node.js 22. This is because
it uses tree-sitter [2] v0.19.x, which does not support Node.js 22.

The version of tree-sitter that works with Node.js 22 is v0.21.0 or
later, as it uses the new Node-API [3] instead of NAN [4] for its Node
bindings.

Since tree-sitter-vue hasn't been updated to use v0.21.0+, it doesn't
work with Node.js 22.

There is no official grammar for Vue that uses tree-sitter v0.21+ and
Node-API yet.

[1] https://github.com/ikatyang/tree-sitter-vue
[2] https://github.com/tree-sitter/tree-sitter
[3] https://nodejs.github.io/node-addon-examples/about/what/
[4] https://github.com/nodejs/nan

Dependencies

swiftlang#952

Testing

Steps:

  1. Run npm install
  2. Run npm run docs
  3. Assert that no Vue components are added to the docs

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • Added tests
  • Ran npm test, and it succeeded
  • Updated documentation if necessary

I chose this version of Node because:

- Latest LTS stability: It's the most recent Long Term Support version,
  providing stability and security updates until April 2026, making it
  ideal for production use.

- Maximum compatibility: It's the highest Node.js version that works
  seamlessly with all existing project dependencies without requiring
  any dependency upgrades.

Update Node.js & NPM to 22.17.0
Since highlight.js 11.6+, the `distributed` keyword is built-in and no
custom overrides are needed
Replace wrapper.find with wrapper.findComponent instead since
wrapper.find is deprecated
contains is deprecated and will be removed in the next major version.
Use `wrapper.find`, `wrapper.findComponent` or `wrapper.get` instead
tree-sitter-vue [1] is not compatible with Node.js 22. This is because
it uses tree-sitter [2] v0.19.x, which does not support Node.js 22.

The version of tree-sitter that works with Node.js 22 is v0.21.0 or
later, as it uses the new Node-API [3] instead of NAN [4] for its Node
bindings.

Since tree-sitter-vue hasn't been updated to use v0.21.0+, it doesn't
work with Node.js 22.

There is no official grammar for Vue that uses tree-sitter v0.21+ and
Node-API yet.

[1] https://github.com/ikatyang/tree-sitter-vue
[2] https://github.com/tree-sitter/tree-sitter
[3] https://nodejs.github.io/node-addon-examples/about/what/
[4] https://github.com/nodejs/nan
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