Comments (4)
Basically a duplicate of #106
no ...
npm install tree-sitter
works on node 18
npm install tree-sitter
fails on node 19 with
../src/logger.cc:44:21: error: ‘class v8::Function’ has no member named ‘CreationContext’; did you mean ‘GetCreationContext’?
cd $(mktemp -d)
npm init -y
node --version # v19.0.0
pnpm i tree-sitter tree-sitter-bash
# error: ‘class v8::Function’ has no member named ‘CreationContext’
nix-shell -p nodejs-18_x # switch to node 18
node --version # v18.12.0
rm -rf node_modules/
pnpm i tree-sitter tree-sitter-bash # ok
cat >index.mjs <<'EOF'
import TreeSitter from "tree-sitter"
import TreeSitterBash from "tree-sitter-bash"
const parser = new TreeSitter()
parser.setLanguage(TreeSitterBash)
const sourceCode = 'asdf'
const tree = parser.parse(sourceCode)
console.dir(tree)
EOF
node index.mjs # ok
cat node_modules/tree-sitter/package.json | jq -r .version # 0.20.1
cat node_modules/tree-sitter-bash/package.json | jq -r .version # 0.19.0
make --version | head -n1 # GNU Make 4.3
gcc --version | head -n1 # gcc (GCC) 10.3.0
python3 --version # Python 3.10.8
from node-tree-sitter.
Basically a duplicate of #106
from node-tree-sitter.
Same issue
from node-tree-sitter.
Also having the same issue, reproducible in a blank GitHub Codespace. Works in node 18, fails in node 19.
Debug log from the build shows the same issue as the original report: debug.log
486 error ../src/logger.cc:44:21: error: ‘class v8::Function’ has no member named ‘CreationContext’; did you mean ‘GetCreationContext’?
486 error 44 | Nan::Call(fn, fn->CreationContext()->Global(), 3, argv);
486 error | ^~~~~~~~~~~~~~~
486 error | GetCreationContext
486 error ../src/logger.cc:51:62: error: ‘class v8::Function’ has no member named ‘CreationContext’; did you mean ‘GetCreationContext’?
486 error 51 | Local<Object> console = Local<Object>::Cast(Nan::Get(fn->CreationContext()->Global(), Nan::New("console").ToLocalChecked()).ToLocalChecked());
486 error | ^~~~~~~~~~~~~~~
486 error | GetCreationContext
486 error make: *** [tree_sitter_runtime_binding.target.mk:131: Release/obj.target/tree_sitter_runtime_binding/src/logger.o] Error 1
486 error gyp ERR! build error
486 error gyp ERR! stack Error: `make` failed with exit code: 2
from node-tree-sitter.
Related Issues (20)
- Tree.rootNode undefined in jest tests due to race condition HOT 4
- Repository name change name to tree-sitter-node HOT 2
- The module 'l\node_modules\tree-sitter\build\Release\tree_sitter_runtime_binding.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 115. This version of Node.js requires NODE_MODULE_VERSION 118. Please try re-compiling or re-installing the module (for instance, using `npm rebuild` or `npm install`) HOT 3
- Can't use in VS Code extension HOT 4
- Invalid language object with tree-sitter v0.21 - caused by NAPI? HOT 4
- node siter fails when included in a react based project and webpack >5 HOT 3
- intermittent `TypeError: NodeClass is not a constructor` when getting tree nodes HOT 7
- Nonexistent property `QueryCapture.text` in typings
- Bug: `Parser.parse(string)` fails if the string length is `>=` than the buffer size HOT 5
- BUG: Parser.Tree#printDotGraph should honor fd
- prebuild `tree-sitter.node` can not dlopen on ubuntu20
- Docs?
- Consider adding an async version of `Parser.parse` HOT 3
- make: *** No rule to make target `Release/obj.target/tree_sitter/vendor/tree-sitter/lib/src/lib.o', needed by `Release/tree_sitter.a'. Stop. HOT 3
- [question] How to query out the classes and funcs from source code? HOT 1
- [question] How do VSCode parse languages? HOT 1
- [question] I searched all the source code of `tree-sitter`, there is no `IdentifierNode`, why there has log? HOT 3
- [question] How to get the inheritance chain of an already obtained class?
- [question] Why use `new Query()` to create query instance, the TypeScript will get error? HOT 3
- [demo request] Is there any demo for using query-syntax #Capturing Nodes?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-tree-sitter.