Skip to content

fail to install plugin #593

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wnykuang opened this issue Jul 1, 2020 · 18 comments
Closed

fail to install plugin #593

wnykuang opened this issue Jul 1, 2020 · 18 comments
Labels
bug Something isn't working
Milestone

Comments

@wnykuang
Copy link

wnykuang commented Jul 1, 2020

🐛 Bug Report

Extension initialization failed.

To Reproduce

  1. uninstall leetcode-vscode
  2. reinstall leetcode-vscode
  3. run the plugin, you will see it.

Expected behavior

leetcode-vscode should be ran smoothly.

Extension Output

v12.18.2
[WARN] Installing missing plugins, might take a while ...

Your Environment

  • os: MacOS 10.15.5
  • extension settings:
  • nodejs version: node-v12.18.2
  • vscode version: 1.46.1
  • extension version: 0.17.0

note:
I believe the problem is caused by the 404 from
https://raw.githubusercontent.com/leetcode-tools/leetcode-cli/master/lib/plugins/github.js

I hope it helps. :D

@AndyYuan96
Copy link

I meet the similar problem yesterday, the error is 404, but I go through plugins installation, I meet 404 when list questions in leetcode-cli, it should be related to your vpn or shadowsocks, finally I didn't solve it. Now I use the leetcode extension in clion IDE,
just login in, nothing to wrong, you can start use.

@wnykuang
Copy link
Author

wnykuang commented Jul 2, 2020

I meet the similar problem yesterday, the error is 404, but I go through plugins installation, I meet 404 when list questions in leetcode-cli, it should be related to your vpn or shadowsocks, finally I didn't solve it. Now I use the leetcode extension in clion IDE,
just login in, nothing to wrong, you can start use.

meh, I am not using any VPN/ssr.

@AndyYuan96
Copy link

I meet the similar problem yesterday, the error is 404, but I go through plugins installation, I meet 404 when list questions in leetcode-cli, it should be related to your vpn or shadowsocks, finally I didn't solve it. Now I use the leetcode extension in clion IDE,
just login in, nothing to wrong, you can start use.

meh, I am not using any VPN/ssr.

I don't know why, as I'm not familar with js, I don't know how to find reason, so other ide may be a good choice.

@yihong0618
Copy link
Contributor

@wnykuang get your point, let me have a check.

@yihong0618
Copy link
Contributor

@wnykuang did you use proxy?

@wnykuang
Copy link
Author

wnykuang commented Jul 2, 2020

@yihong0618 nope, I didn't change any settings about the internet.

Could you open the URL?

https://raw.githubusercontent.com/leetcode-tools/leetcode-cli/master/lib/plugins/github.js

@yihong0618
Copy link
Contributor

@yihong0618 nope, I didn't change any settings about the internet.

Could you open the URL?

https://raw.githubusercontent.com/leetcode-tools/leetcode-cli/master/lib/plugins/github.js

No, but its not the 404 url problem, github.js is the third party plugin which would not install usually, I have tried three different environment but I didn't locate your problem yet.

@wnykuang
Copy link
Author

wnykuang commented Jul 2, 2020

@yihong0618
interesting.

Do you need any more information?
like some npm call or so?

@yihong0618
Copy link
Contributor

@yihong0618
interesting.

Do you need any more information?
like some npm call or so?

Yes what my guess is you use vscode-leetcode or leetcode-cli before and installed these third-party plugins maybe you are not notice, am I right?

@wnykuang
Copy link
Author

wnykuang commented Jul 2, 2020

@yihong0618
I have used leetcode-cli for years until last year I cannot log in anymore.
Do you know how to reset/delete the plugins?

@yihong0618
Copy link
Contributor

@wnykuang
If so, can you make a test that remove the cache, use rm -rf ~/.lc/ and try to login again.

@wnykuang
Copy link
Author

wnykuang commented Jul 2, 2020

@yihong0618

after rm -rf ~/.lc/ the leetcode-vscode works!

Thank you!

@wnykuang wnykuang closed this as completed Jul 2, 2020
@yihong0618
Copy link
Contributor

@yihong0618
I have used leetcode-cli for years until last year I cannot log in anymore.
Do you know how to reset/delete the plugins?

My thinking is that use use third-party github.js and it saves in cache, and this time need to update caused these error.

@jdneo
Copy link
Member

jdneo commented Jul 2, 2020

@yihong0618 @zry656565 Seems that we need a way to make sure users are in a fresh env when they first use the extension. Like store some flags in the extension's global storage. If it's first time using the extension, clean the cache dir before activate

@jdneo jdneo added the question label Jul 2, 2020
@yihong0618
Copy link
Contributor

yihong0618 commented Jul 2, 2020

@yihong0618

after rm -rf ~/.lc/ the leetcode-vscode works!

Thank you!

My pleasure
@AndyYuan96 can you try this too?

@yihong0618
Copy link
Contributor

@jdneo @zry656565
Can we make a popup on this error handling? Tell the user error hanpens and let user decide delete the cache or not.

        for (const plugin of supportedPlugins) {
            try { // Check plugin
                await this.executeCommandEx(this.nodeExecutable, [await this.getLeetCodeBinaryPath(), "plugin", "-e", plugin]);
            } catch (error) { // Download plugin and activate
                // popup
                await this.executeCommandEx(this.nodeExecutable, [await this.getLeetCodeBinaryPath(), "plugin", "-i", plugin]);
            }
        }

@jdneo
Copy link
Member

jdneo commented Jul 2, 2020

This is a good way to handle the error. While we also need a way to eliminate those errors at the first stage. For example, in the activate(), check if there is a certain flag in the global storage. If not, clean the cache, and generate the flag before the activate() finishes.

@milpita
Copy link

milpita commented Jan 21, 2021

I noticed it failed due to extension not supporting older vscode-1.36 (june 2019). Make sure vscode up to date (worked on 1.52.1) and try installing again. If problem persists, this can help troubleshoot, download the vsix and in cmd: code --install-extension path_to_vsix_file --verbose.

@jdneo jdneo added bug Something isn't working and removed question labels Jun 8, 2021
@jdneo jdneo added this to the 0.18.0 milestone Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants