Giter Site home page Giter Site logo

Comments (4)

milahu avatar milahu commented on September 23, 2024 2

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.

razzeee avatar razzeee commented on September 23, 2024 1

Basically a duplicate of #106

from node-tree-sitter.

SamStenner avatar SamStenner commented on September 23, 2024

Same issue

from node-tree-sitter.

richardTowers avatar richardTowers commented on September 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.