Skip to content
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

[bug][javascript] vvXgSW #1360

Closed
1 of 2 tasks
labuladong opened this issue Mar 26, 2023 · 2 comments · May be fixed by #1580
Closed
1 of 2 tasks

[bug][javascript] vvXgSW #1360

labuladong opened this issue Mar 26, 2023 · 2 comments · May be fixed by #1580
Labels
help wanted Extra attention is needed

Comments

@labuladong
Copy link
Owner

此 issue 的目的是修复 chatGPT 转译的多语言代码,更详细的背景信息和修复流程见:#1113

请在提交 bug 之前先搜索

  • 我已经搜索过 issues,没有发现相同的 bug。

出错的题目链接

https://leetcode.cn/problems/vvXgSW/

报错信息

Line 12: TypeError: pq.add is not a function
Line 12 in solution.js
            pq.add(head);
               ^
TypeError: pq.add is not a function
    Line 12: Char 16 in solution.js (mergeKLists)
    Line 36: Char 19 in solution.js (Object.<anonymous>)
    Line 16: Char 8 in runner.js (Object.runner)
    Line 27: Char 26 in solution.js (Object.<anonymous>)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47

你是否愿意提交 PR 修复这个 bug?

  • 我愿意!
@labuladong labuladong added the help wanted Extra attention is needed label Mar 26, 2023
@onukwilip
Copy link

It says that pq.add is not a function, hence it's either undefined, null or another datatype. I suggest you do something like this to avoid the issue

if (typeof pd?.add === "function") pd.add()

@Jayden12138
Copy link
Contributor

It says that pq.add is not a function, hence it's either undefined, null or another datatype. I suggest you do something like this to avoid the issue

if (typeof pd?.add === "function") pd.add()

This is fine as far as error handling is concerned, but the main problem here is that the version of the third-party library introduced in leetcode is not always up-to-date, and he's in such an old version that he can't use these methods
What are the environments for the programming languages?
Check out this link for details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants