ValdezFOmar / tree-sitter-editorconfig

Editorconfig grammar for tree-sitter
MIT License
2 stars 0 forks source link

bug: Error [ERR_REQUIRE_ESM]: require() of ES Module #11

Open jcs090218 opened 1 week ago

jcs090218 commented 1 week ago

Did you check existing issues?

Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)

0.22.2

Describe the bug

node:internal/modules/cjs/loader:1544
      throw err;
      ^

Error [ERR_REQUIRE_ESM]: require() of ES Module C:\Users\XXX\Documents\_lang\elisp\tree-sitter-langs\repos\editorconfig\grammar.js from C:\Users\JenChieh\Documents\_lang\elisp\tree-sitter-langs\repos\editorconfig\[stdin] not supported.
Instead change the require of grammar.js in C:\Users\XXX\Documents\_lang\elisp\tree-sitter-langs\repos\editorconfig\[stdin] to a dynamic import() which is available in all CommonJS modules.
    at [stdin]:417:16
    at [stdin]-wrapper:6:24 {
  code: 'ERR_REQUIRE_ESM'
}

Node.js v20.17.0
Node process exited with status 1

Steps To Reproduce/Bad Parse Tree

N/A

Expected Behavior/Parse Tree

N/A

Repro

1. Clone this repo
2. npm install
3. tree-sitter generate
ValdezFOmar commented 1 week ago

Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)

The latest

Could you please post the actual output of running tree-sitter --version?

jcs090218 commented 1 week ago

0.22.2

ValdezFOmar commented 1 week ago

You are not using the latest version as you claimed, the latest version is 0.24.3. Update your version and try generating the parser again.

ValdezFOmar commented 1 week ago

@jcs090218 why did you closed it? and why did you mean by "not worth the effort"? if you think that I'm in the wrong here then please explain to me why you think so.

I see that you're trying to use the parser for emacs, but I'm don't know anything about emacs, so I'm probably missing some important info about why you're not able to use the parser. For instance, the parser is use by nvim-treesitter and there's no problems reported there about this parser not working.