Giter Site home page Giter Site logo

Comments (7)

verhovsky avatar verhovsky commented on May 27, 2024

I've also just seen this error

Error: Invalid argument
    at get namedChildren [as namedChildren] (/Users/space/code/curlconverter/node_modules/tree-sitter/index.js:166:39)
    at extractCommandNodes (/Users/space/code/curlconverter/src/shell/tokenizer.ts:580:32)
    at tokenize (/Users/space/code/curlconverter/src/shell/tokenizer.ts:722:24)
    at findCommands (/Users/space/code/curlconverter/src/parse.ts:31:12)
    at parse (/Users/space/code/curlconverter/src/parse.ts:58:24)
    at toClojureWarn (/Users/space/code/curlconverter/src/generators/clojure.ts:515:20)
    at Object.toClojure (/Users/space/code/curlconverter/src/generators/clojure.ts:520:10)
    at <anonymous> (/Users/space/code/curlconverter/test/test.ts:95:28)

I re-ran the tests without any changes and got the TypeError: NodeClass is not a constructor error. Re-ran without changes a third time and they passed.

from node-tree-sitter.

verhovsky avatar verhovsky commented on May 27, 2024

It's fairly common actually, it happened in the CI as well

https://github.com/curlconverter/curlconverter/actions/runs/8385221889/job/22963783256?pr=645#step:5:31

from node-tree-sitter.

verhovsky avatar verhovsky commented on May 27, 2024

@segevfiner could this be related to the NAPI changes or something in the upstream tree-sitter C code?

from node-tree-sitter.

segevfiner avatar segevfiner commented on May 27, 2024

It could be... But I'm not really sure what could possibly cause this. Guess some good old fashioned debugging is in order... 😛

from node-tree-sitter.

verhovsky avatar verhovsky commented on May 27, 2024

Turns out #190 (comment) is not related to Jest.

from node-tree-sitter.

segevfiner avatar segevfiner commented on May 27, 2024

@verhovsky The bug seems to be that we are holding a weak reference in cached_nodes_, yet the finalizer hasn't been called yet, as per Node.js docs:

Finalizer callbacks may be deferred, leaving a window where the object has been garbage collected (and the weak reference is invalid) but the finalizer hasn't been called yet. When using napi_get_reference_value() on weak references returned by napi_wrap(), you should still handle an empty result.

from node-tree-sitter.

verhovsky avatar verhovsky commented on May 27, 2024

Fixed by #197

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.