Skip to content

Unknown language "javascript" #80

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
fuermosi777 opened this issue Dec 15, 2017 · 17 comments
Closed

Unknown language "javascript" #80

fuermosi777 opened this issue Dec 15, 2017 · 17 comments

Comments

@fuermosi777
Copy link

Problem Summary

run leetcode show 523 -x -g, got an error

[ERROR] Unknown language "javascript" [0]

How to reproduce

Skip

Environment

[Environment]
Node v7.7.2
OS darwin 17.2.0

[Configuration]
AUTO_LOGIN true
COLOR_THEME default
ICON_THEME
LANG javascript
MAX_WORKERS 10
USE_COLOR true

[Themes]
Colors blue,dark,default,orange,pink
Icons ascii,default,win7

@zhangxiliang
Copy link

I have this problem, too

@wwelder
Copy link

wwelder commented Dec 16, 2017

Same here, no matter which language I choose. I guess there might be some changes to leetcode's API.

@wzjmit
Copy link

wzjmit commented Dec 16, 2017

It seems that leetcode had removed templates and testcase from pageData

problem.templates = pageData.codeDefinition;
problem.testcase = pageData.sampleTestCase;
problem.testable = pageData.enableRunCode;

skygragon added a commit that referenced this issue Dec 16, 2017
* update to support recent leetcode.com change.

Signed-off-by: Eric Wang <[email protected]>
@skygragon
Copy link
Owner

skygragon commented Dec 16, 2017

Yep, leetcode.com is using a new API o fetch question details, that's why we failed to get detailed info from "pageData" in the old html.

I have made a quick fix for it but have no time for a full regression testings right now (e.g. submission, star command, and 3rd party plugins). While you guys can still try it out now to see if there are other errors remained:

$ npm install -g skygragon/leetcode-cli

please ping me for any errors you meet, will revisit this tomorrow I hope.

@wwelder
Copy link

wwelder commented Dec 16, 2017

It works for me. Thanks for your hotfix!

@wwelder
Copy link

wwelder commented Dec 16, 2017

It is not totally fixed. I can show most problems properly now, but some not.
For example, lc 537 still shows Unknown language error.

leetcode show 537 -g -x

@skygragon
Copy link
Owner

@GameBurning try clean cache?

leetcode cache -d 537.complex-number-multiplication.algorithms

@wwelder
Copy link

wwelder commented Dec 16, 2017

@skygragon Thanks! The cached json is the cause.

skygragon added a commit that referenced this issue Dec 16, 2017
@yefeiw
Copy link

yefeiw commented Dec 17, 2017

My two cents since I had the exact same problem...

Make sure we call "leetcode cache -d" before trying again after upgrading the leetcode cli. That will clean all caches and will make sure we don't see similar problems again.

@pengyu-hou
Copy link

Reinstallation and cleaning the cache solved the problem for me.

npm install -g skygragon/leetcode-cli
leetcode cache -d true

@fuermosi777
Copy link
Author

Worked after upgrading to 2.1.0 and clear cache.

@Pyboon
Copy link

Pyboon commented Dec 19, 2017

I meet this problem again : [ERROR] Unknown language "cpp" [0]
yesterday I have upgraded to new version 2.1 and work well but the issue appears today

@skygragon
Copy link
Owner

@Pyboon give another try after running leetcode cache -d?

@Pyboon
Copy link

Pyboon commented Dec 19, 2017

still have trouble

@skygragon
Copy link
Owner

@Pyboon 175/176/181 are all sql questions, so "cpp" doesn't work for them. please try:

leetcode show 175 -gx -l mysql

@Pyboon
Copy link

Pyboon commented Dec 19, 2017

I found that some problems occured the issue but some did not, for example problem #181,#176.#175 had but #198 not, I just try some problems and do not konw the detail of other problems

@skygragon
Copy link
Owner

@Pyboon in the case you could omit "-gx" in your show command then you could see the question details first before generating source code via "-g".

skygragon added a commit that referenced this issue Dec 19, 2017
15cm pushed a commit to 15cm/leetcode-cli that referenced this issue Jun 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants