Comments (10)
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.
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.
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.
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.
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.
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.
(/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.
Hi, I've got the same issue. Using nvm.
from coc-python.
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.
@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)
- yarn install --frozen-lockfile fails HOT 2
- Intellisense low on offers HOT 1
- Cannot disable linting HOT 1
- Wrong Pyright errors. HOT 1
- python.createTerminal not activating virtual env
- iPython as interpreter
- How to make reappear the info of a function
- Why did this happen whenever I opened a python file HOT 1
- "Linter pylint is not installed." Even though it is.
- coc formatter deleting lines when formatting sometimes HOT 1
- Black does not support the "Format Selection" command
- Modified the wrong code, but the underline still exists. HOT 1
- Can't get out of the terminal one interacted with HOT 1
- Uncaught Exception Error on Windows!
- Default ctags exclude list is unconfigurable HOT 1
- Jedi error raised on python completion HOT 2
- Silence [coc.nvim]: Uncaught exception: spawn python2 ENOENT HOT 4
- Autocompletion through Coc vs VS Code HOT 2
- Settings
- Error float window hangs and then not able to get completion HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coc-python.