login issue
I got the issue blow.
SyntaxError: Unexpected end of input
at Object.parse (native)
at Object.cache.get (C:\Users\afu.vscode\extensions\shengchen.vscode-leetcode-0.6.1\node_modules\leetcode-cli\lib\cache.js:17:15)
at Function.__dirname.Plugin.deps.deps.Plugin.init.plugins [as init] (C:\Users\afu.vscode\extensions\shengchen.vscode-leetcode-0.6.1\node_modules\leetcode-cli\lib\plugin.js:131:22)
at Object.cli.run (C:\Users\afu.vscode\extensions\shengchen.vscode-leetcode-0.6.1\node_modules\leetcode-cli\lib\cli.js:82:14)
at Object.
Hi @Allen-Zfu,
Thank you for your feedback. Could this problem be stable reproduced? If yes, could you please tell me the reproduce steps?
hi,
Actually i have never login successfully, each time i type username and password, i goy this issue.
thanks,
Sent from my iPhone
On Jul 1, 2018, at 9:28 PM, Sheng Chen <[email protected]mailto:[email protected]> wrote:
Hi @Allen-Zfuhttps://github.com/Allen-Zfu,
Thank you for your feedback. Could this problem be stable reproduced? If yes, could you please tell me the reproduce steps?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/jdneo/vscode-leetcode/issues/44#issuecomment-401648592, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AgPrt6URR-bjZZQr_WgaXorqDIsxOAynks5uCXcmgaJpZM4U-HSW.
I see. the plugin is using leetcode-cli as the back-end. If you cannot login through the plugin, could you please try login with leetcode-cli directly? The steps are:
- Install leetcode cli:
npm install -g leetcode-cli leetcode user -l
Hi @Allen-Zfu. Does this issue still occur?
@jdneo I ran into login issue too.
By inspecting the request this extension made, I found that the endpoint is "leetcode-cn.com" instead of "leetcode.com" while I leaved the "Switch endpoint" unchanged at "Off". By the way, I tried the leetcode-cli you mentioned, and I found the exact same behavior with its default settings.
My solution is to "Switch endpoint" back and forth, and it just worked.
error message and stack:
SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at Object.cache.get (/Users/{MY_USERNAME}/.vscode/extensions/shengchen.vscode-leetcode-0.8.0/node_modules/leetcode-cli/lib/cache.js:17:15)
at Plugin.save (/Users/{MY_USERNAME}/.vscode/extensions/shengchen.vscode-leetcode-0.8.0/node_modules/leetcode-cli/lib/plugin.js:71:22)
at Function.Plugin.save (/Users/{MY_USERNAME}/.vscode/extensions/shengchen.vscode-leetcode-0.8.0/node_modules/leetcode-cli/lib/plugin.js:206:33)
at Object.cli.run (/Users/{MY_USERNAME}/.vscode/extensions/shengchen.vscode-leetcode-0.8.0/node_modules/leetcode-cli/lib/cli.js:83:12)
at Object.<anonymous> (/Users/{MY_USERNAME}/.vscode/extensions/shengchen.vscode-leetcode-0.8.0/node_modules/leetcode-cli/bin/leetcode:3:23)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
[ERROR] You are not login yet? [0]
login: pass: [ERROR] invalid password? [0]
@unidentifiedme
Yes, I found several users encountered this same issue. Not sure who to blame now. 😞
Closing since no more reply from the issue creator for a long time.
Note: It should be the password of http://leetcode.com, not the password of https://leetcode-cn.com.
Note: It should be the password of http://leetcode.com, not the password of https://leetcode-cn.com.
Thanks,I've mixed up them.