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

TypeError: User is not a constructor #32

Closed
Curstantine opened this issue Mar 9, 2021 · 3 comments
Closed

TypeError: User is not a constructor #32

Curstantine opened this issue Mar 9, 2021 · 3 comments

Comments

@Curstantine
Copy link

            let user = new User(data.leader.id);
                       ^

TypeError: User is not a constructor
    at Group._parse (/node_modules/mangadex-full-api/src/structure/group.js:71:24)
    at /node_modules/mangadex-full-api/src/structure/group.js:146:22
    at processTicksAndRejections (node:internal/process/task_queues:94:5)

This is while calling for group data.

    async function group(){
      api.agent.login(usrname, pass, false).then(async () => {
        var group = new api.Group();
        await group.fillByQuery("Doki Fansubs");
        console.log(`${group.title} | ${group.leader} | ${group.id}`);
        })
        }
@wiredmatt
Copy link

wiredmatt commented Mar 9, 2021

Add await before api.agent.login(...)

@Curstantine
Copy link
Author

Curstantine commented Mar 10, 2021

But I haven't added await for agent login for User, manga, etc.
But yeah I'll try thanks!
As expected didn't work.

@md-y
Copy link
Owner

md-y commented Mar 10, 2021

That might be another issue, but I had the same error even with the await.

However, it should be fixed in the newest release.

@md-y md-y closed this as completed Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants