JacobLinCool / JacobLinCool/LeetCode-Query
Unable to get User Information
- Dominant language
- TypeScript
- Stars
- 130
- Forks
- 23
- PR merge metrics
- No merged PRs in 30d
Description
# Unable to get user information
## Code used to reproduce
```js
import { LeetCode } from "leetcode-query";
const leetcode = new LeetCode();
const user = await leetcode.user("username");
```
## Error
```bash
Uncaught (in promise) TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation
at _fetch (index.js:71:1)
at get_csrf (index.js:87:1)
at Credential.init (index.js:111:1)
at getUser (Card.js:10:1)
at Card (Card.js:15:1)
at renderWithHooks (react-dom.development.js:15486:1)
at mountIndeterminateComponent (react-dom.development.js:20103:1)
at beginWork (react-dom.development.js:21626:1)
at beginWork$1 (react-dom.development.js:27465:1)
at performUnitOfWork (react-dom.development.js:26596:1)
```
Help me with this. @JacobLinCool
Contributor guide
No contributing guide indexed for this repository
Research direction
The failure is reported through index.js at _fetch, get_csrf, and Credential.init, with Card.js calling getUser. Reproduce the browser call shown in the issue and trace the fetch invocation; done means leetcode.user("username") returns user information without the Illegal invocation error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100