最近试图在工作之余摸摸鱼,却发现VSCode上LeetCode提交不了代码。
检查了一下output,报了下面的错误:
- Sending code to judge
(node:15248) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
看主流的解决方法有三种:
- 把Node版本降到14以下
- 用美区账号登录
- 用Cookie登录
权衡了一下,觉得Cookie登录的方法最好,Cookie的获取方式如下:
4. 打开登录状态的leetcode.com
5. 打开控制台/开发者工具,选择Network标签
6. 刷新网页,在左边的列表里找到 graphql/
7.然后在右边的Request Headers里找到cookie,把后面的内容完整复制下来即可。