Giter Site home page Giter Site logo

Comments (10)

ebkalderon avatar ebkalderon commented on June 15, 2024

Update: it seems that a different version of Node.js is being selected than I expected, according to the contents of :CocOpenLog shown below:

2019-03-27T14:26:17.829 INFO (pid:35920) [services] - registed service "languageserver.bash"
2019-03-27T14:26:17.830 INFO (pid:35920) [services] - registed service "languageserver.dockerfile"
2019-03-27T14:26:17.831 INFO (pid:35920) [services] - registed service "languageserver.gluon"
2019-03-27T14:26:17.986 ERROR (pid:35920) [util-factoroy] - TypeError: Reflect.hasOwnMetadata is not a function
    at /Users/eyalkalderon/.config/coc/extensions/node_modules/inversify/lib/annotation/injectable.js:7:21
    at Object.__decorate (/Users/eyalkalderon/.config/coc/extensions/node_modules/tslib/tslib.js:90:99)
    at Object.<anonymous> (/Users/eyalkalderon/.config/coc/extensions/node_modules/coc-python/lib/common/utils/random.js:25:18)
    at Module._compile (/snapshot/coc.nvim/lib/util/factory.js:67:32)
    at Object.Module._extensions..js (module.js:644:10)
    at Module.load (module.js:552:32)
    at tryModuleLoad (module.js:495:12)
    at Function.Module._load (module.js:487:3)
    at Module.require (module.js:577:17)
    at Module.require (pkg/prelude/bootstrap.js:1159:31)
2019-03-27T14:26:18.067 INFO (pid:35920) [services] - registed service "eslint"
2019-03-27T14:26:18.071 INFO (pid:35920) [plugin] - coc initialized with node: v8.9.0
2019-03-27T14:26:21.174 ERROR (pid:35920) [util-factoroy] - TypeError: Reflect.hasOwnMetadata is not a function
    at /Users/eyalkalderon/.config/coc/extensions/node_modules/inversify/lib/annotation/injectable.js:7:21
    at Object.__decorate (/Users/eyalkalderon/.config/coc/extensions/node_modules/tslib/tslib.js:90:99)
    at Object.<anonymous> (/Users/eyalkalderon/.config/coc/extensions/node_modules/coc-python/lib/common/utils/random.js:25:18)
    at Module._compile (/snapshot/coc.nvim/lib/util/factory.js:67:32)
    at Object.Module._extensions..js (module.js:644:10)
    at Module.load (module.js:552:32)
    at tryModuleLoad (module.js:495:12)
    at Function.Module._load (module.js:487:3)
    at Module.require (module.js:577:17)
    at Module.require (pkg/prelude/bootstrap.js:1159:31)

from coc-python.

ebkalderon avatar ebkalderon commented on June 15, 2024

This StackOverflow post suggests that this type error with Inversify can be fixed by installing the reflect-metadata package. I will try entering the .config/coc/extensions/node_modules, attempt to install the package using yarn, and see if it works.

from coc-python.

ebkalderon avatar ebkalderon commented on June 15, 2024

Unfortunately, it didn't work. I still receive the same error:

2019-03-27T14:31:47.806 ERROR (pid:36138) [util-factoroy] - TypeError: Reflect.hasOwnMetadata is not a function
    at /Users/eyalkalderon/.config/coc/extensions/node_modules/inversify/lib/annotation/injectable.js:7:21
    at Object.__decorate (/Users/eyalkalderon/.config/coc/extensions/node_modules/tslib/tslib.js:90:99)
    at Object.<anonymous> (/Users/eyalkalderon/.config/coc/extensions/node_modules/coc-python/lib/common/utils/random.js:25:18)
    at Module._compile (/snapshot/coc.nvim/lib/util/factory.js:67:32)
    at Object.Module._extensions..js (module.js:644:10)
    at Module.load (module.js:552:32)
    at tryModuleLoad (module.js:495:12)
    at Function.Module._load (module.js:487:3)
    at Module.require (module.js:577:17)
    at Module.require (pkg/prelude/bootstrap.js:1159:31)
2019-03-27T14:31:47.953 INFO (pid:36138) [services] - registed service "eslint"
2019-03-27T14:31:47.958 INFO (pid:36138) [plugin] - coc initialized with node: v8.9.0
2019-03-27T14:31:52.277 ERROR (pid:36138) [util-factoroy] - TypeError: Reflect.hasOwnMetadata is not a function
    at /Users/eyalkalderon/.config/coc/extensions/node_modules/inversify/lib/annotation/injectable.js:7:21
    at Object.__decorate (/Users/eyalkalderon/.config/coc/extensions/node_modules/tslib/tslib.js:90:99)
    at Object.<anonymous> (/Users/eyalkalderon/.config/coc/extensions/node_modules/coc-python/lib/common/utils/random.js:25:18)
    at Module._compile (/snapshot/coc.nvim/lib/util/factory.js:67:32)
    at Object.Module._extensions..js (module.js:644:10)
    at Module.load (module.js:552:32)
    at tryModuleLoad (module.js:495:12)
    at Function.Module._load (module.js:487:3)
    at Module.require (module.js:577:17)
    at Module.require (pkg/prelude/bootstrap.js:1159:31)

In fact, I'm now seeing another error in the statusline that wasn't there before:

[coc.nvim] engine coc & vscode not found in /Users/eyalkalderon/.config/coc/extensions/node_modules/reflect-metadata/package.json

I think I am going to completely uninstall and reinstall coc.nvim.

from coc-python.

ebkalderon avatar ebkalderon commented on June 15, 2024

Okay, I suspect I know what is happening. I am using the Nix package manager to manage my toolchains on macOS, including yarn. According to NixOS/nixpkgs#48705, it appears that the package provided for yarn in Nixpkgs is pinned to Node.js 8, instead of using whatever Node version is present in the environment.

To confirm whether this is really the problem, I will completely uninstall coc.nvim and then run:

nix-shell -p '(yarn.override { nodejs = nodejs-11_x; })' -p other-coc.nvim-system-deps-here

Once the environment is loaded up, I will attempt to reinstall coc.nvim and coc-python and see if that fixes the issue.

from coc-python.

ebkalderon avatar ebkalderon commented on June 15, 2024

Well, it doesn't appear to have fixed the problem. It resulted in no change, even after completely removing the ~/.config/coc directory and the plugged/coc.nvim directory and reinstalling. Looking into the coc.nvim source code, it appears that the package.json specifies the following targets anyway:

"targets": [
  "node8-linux-x64",
  "node8-macos-x64",
  "node8-win-x64"
]

So I think the Node.js version discrepancy here is a red herring, because yarn installed via nix-env is already pinned to Node 8 anyway. Not really sure how to proceed from here. @chemzqm, do you have any ideas?

from coc-python.

ebkalderon avatar ebkalderon commented on June 15, 2024

Hmm, I noticed that when I run :CocInstall coc-python, there is a warning message by yarn that actually looks relevant because the type error is occurring in the inversify package:

warning: coc-python > [email protected]: Re-Released as 5.0.1

Can anyone reproduce?

from coc-python.

chemzqm avatar chemzqm commented on June 15, 2024

(/snapshot/coc.nvim/lib/util/factory.js:67:32)

it means you're using binary release, call coc#util#build() to fix it.

from coc-python.

robjuffermans avatar robjuffermans commented on June 15, 2024

Hi, I've got the same issue. Using nvm.

from coc-python.

chemzqm avatar chemzqm commented on June 15, 2024

https://github.com/neoclide/coc.nvim/wiki/F.A.Q#how-to-use-cocnvim-from-master-branch

Checkout :h g:coc_node_path if you're using nvm.

from coc-python.

ebkalderon avatar ebkalderon commented on June 15, 2024

@chemzqm Awesome, call coc#util#build() fixes the problem! Thank you. I'm assuming the binary release will be fixed as well on a later date?

from coc-python.

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.