miyako / language-4dform

Atom language support for 4D
MIT License
0 stars 1 forks source link

Failed to load a language-4dform package grammar #1

Closed dbeaubien closed 4 years ago

dbeaubien commented 4 years ago

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.47.0 x64 Electron: 5.0.13 OS: Mac OS X 10.14.6 Thrown From: language-4dform package 0.2.0

Stack Trace

Failed to load a language-4dform package grammar

At The module '/Users/dbeaubien/.atom/packages/language-4dform/node_modules/tree-sitter-json/build/Release/tree_sitter_json_binding.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 69. This version of Node.js requires
NODE_MODULE_VERSION 70. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`). in /Users/dbeaubien/.atom/packages/language-4dform/grammars/4dform.cson

Error: The module '/Users/dbeaubien/.atom/packages/language-4dform/node_modules/tree-sitter-json/build/Release/tree_sitter_json_binding.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 69. This version of Node.js requires
NODE_MODULE_VERSION 70. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at process.func [as dlopen] (electron/js2c/asar.js:138:31)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:881:18)
    at Object.func [as .node] (electron/js2c/asar.js:138:31)
    at Module.load (internal/modules/cjs/loader.js:701:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:633:12)
    at Function.Module._load (internal/modules/cjs/loader.js:625:3)
    at Module.require (/app.asar/static/index.js:72:46)
    at require (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:146766)
    at /app.asar/node_modules/tree-sitter-json/index.js:2:20)
    at /app.asar/node_modules/tree-sitter-json/index.js:11:3)
    at Module.get_Module._compile (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:147450)
    at Object.value [as .js] (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:150998)
    at Module.load (internal/modules/cjs/loader.js:701:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:633:12)
    at Function.Module._load (internal/modules/cjs/loader.js:625:3)
    at Module.require (/app.asar/static/index.js:72:46)
    at require (internal/modules/cjs/helpers.js:14:16)
    at customRequire (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:1:695414)
    at new TreeSitterGrammar (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:3116620)
    at GrammarRegistry.createGrammar (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:360231)
    at /Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:360072
    at /Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:581958
    at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:54:3)
  at /packages/language-4dform/grammars/4dform.cson:1:1

Commands

Non-Core Packages

atom-beautify 0.33.4 
atom-html-templates 0.1.3 
busy-signal 2.0.1 
emmet 2.4.3 
file-icons 2.1.41 
intentions 1.1.5 
language-4dcatalog 0.11.0 
language-4dform 0.2.0 
language-4dlink 0.4.0 
language-4dm 1.6.0 
language-4dpreferences 0.15.0 
language-4dproject 0.2.0 
language-4dtag 0.19.0 
language-vue 0.26.0 
language-vue-component 0.5.0 
line-ending-converter 1.3.2 
linter 2.3.1 
linter-ui-default 1.8.1 
minimap 4.29.9 
php-cs-fixer 4.1.1 
platformio-ide-terminal 2.10.0 
text-manipulation 0.6.0 
vue2-autocomplete 0.1.0-alpha.4 
vuejs2-snippets 1.1.0 
miyako commented 4 years ago

are you trying to suggest that upgrading Atom from 1.46.0 to 1.47.0 generates an error?

I am using 1.46.0 and I don't see any error.

can you please try 1.46.0 and report if there are any differences?

when reporting an issue, it is important to consider the possibility that not everyone is having the same issue, it may be just you.

dbeaubien commented 4 years ago

I am just passing along the issue. It is probably tied to 1.47.0. It actually happens on all these Atom packages: language-4dcatalog, language-4dpreferences, language-4dlink, language-4dproject, and language-4dm

miyako commented 4 years ago

I suspect it is an issue with tree-sitter-json.

I think it is unsafe to use Atom 1.47.0.

Use 1.46.0.

> tree-sitter-json@0.14.0 install /private/var/folders/19/45d7qmr50rsd5x0w5rrfzr540000gn/T/apm-install-dir-2020421-96884-1wtw1at.uf8f/node_modules/language-4dform/node_modules/tree-sitter-json
> node-gyp rebuild

  CC(target) Release/obj.target/tree_sitter_json_binding/src/parser.o
  CXX(target) Release/obj.target/tree_sitter_json_binding/src/binding.o

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
../src/binding.cc:13:6: error: variable has incomplete type 'void'
void Init(Handle<Object> exports, Handle<Object> module) {
     ^
../src/binding.cc:13:11: error: use of undeclared identifier 'Handle'
void Init(Handle<Object> exports, Handle<Object> module) {
          ^
../src/binding.cc:13:18: error: 'Object' does not refer to a value
void Init(Handle<Object> exports, Handle<Object> module) {
                 ^
/Users/miyako/.atom/.node-gyp/.node-gyp/5.0.13/include/node/v8.h:3257:17: note: declared here
class V8_EXPORT Object : public Value {
                ^
../src/binding.cc:13:26: error: use of undeclared identifier 'exports'
void Init(Handle<Object> exports, Handle<Object> module) {
                         ^
../src/binding.cc:13:35: error: use of undeclared identifier 'Handle'
void Init(Handle<Object> exports, Handle<Object> module) {
                                  ^
../src/binding.cc:13:42: error: 'Object' does not refer to a value
void Init(Handle<Object> exports, Handle<Object> module) {
                                         ^
/Users/miyako/.atom/.node-gyp/.node-gyp/5.0.13/include/node/v8.h:3257:17: note: declared here
class V8_EXPORT Object : public Value {
                ^
../src/binding.cc:13:50: error: use of undeclared identifier 'module'
void Init(Handle<Object> exports, Handle<Object> module) {
                                                 ^
../src/binding.cc:13:57: error: expected ';' after top level declarator
void Init(Handle<Object> exports, Handle<Object> module) {
                                                        ^
                                                        ;
8 errors generated.
make: *** [Release/obj.target/tree_sitter_json_binding/src/binding.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Applications/Atom.app/Contents/Resources/app/apm/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Darwin 19.3.0
gyp ERR! command "/Applications/Atom.app/Contents/Resources/app/apm/bin/node" "/Applications/Atom.app/Contents/Resources/app/apm/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /private/var/folders/19/45d7qmr50rsd5x0w5rrfzr540000gn/T/apm-install-dir-2020421-96884-1wtw1at.uf8f/node_modules/language-4dform/node_modules/tree-sitter-json
gyp ERR! node -v v10.2.1
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok 
npm WARN enoent ENOENT: no such file or directory, open '/private/var/folders/19/45d7qmr50rsd5x0w5rrfzr540000gn/T/apm-install-dir-2020421-96884-1wtw1at.uf8f/package.json'
npm WARN apm-install-dir-2020421-96884-1wtw1at.uf8f No description
npm WARN apm-install-dir-2020421-96884-1wtw1at.uf8f No repository field.
npm WARN apm-install-dir-2020421-96884-1wtw1at.uf8f No README data
npm WARN apm-install-dir-2020421-96884-1wtw1at.uf8f No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! tree-sitter-json@0.14.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the tree-sitter-json@0.14.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/miyako/.atom/.apm/_logs/2020-05-20T22_43_00_292Z-debug.log
miyako commented 4 years ago

Since the official tree-sitter-json is not updated (recompiled) yet, I have forked and renamed it as 4djson/fourdjson, recompiled and published on apm.

language-4dform and language-4dproject are updated to link against this fork.

Also, I've recompiled 4dxml and 4dm tree-sitter parsers.

miyako commented 4 years ago

Please let me know if updating the packages removes these errors.

dbeaubien commented 4 years ago

I have updated the packages and all errors are now gone. Thanks for that. :)