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

Typescript options error #66

Closed
nickluger opened this issue Apr 8, 2022 · 6 comments · Fixed by #88
Closed

Typescript options error #66

nickluger opened this issue Apr 8, 2022 · 6 comments · Fixed by #88
Assignees

Comments

@nickluger
Copy link

nickluger commented Apr 8, 2022

This starter example from the docs:

gotScraping
    .get({
        url: 'https://apify.com',
        proxyUrl: 'http://usernamed:[email protected]:1234',
    })

leads to the following TS error on TS v4.6.2

TS2769: No overload matches this call.   
The last overload gave the following error.     
Argument of type '{ url: string; proxyUrl: string; }' is not assignable to parameter of type 'OptionsInit'.       
Object literal may only specify known properties, and 'proxyUrl' does not exist in type 'OptionsInit'.

The same happen for any other got-scraping-provided context fields like useHeaderGenerator.

Using version 3.2.8 of this package (for some reason, the latest git tag isv3.7.8, but I assume that's the same?)

@aN00B1s
Copy link

aN00B1s commented Jun 26, 2022

May you check this problem please? @szmarczak

@szmarczak
Copy link
Contributor

szmarczak commented Jul 9, 2022

This is currently blocked by sindresorhus/got#1117. If you didn't use the .get shortcut, it should work. Or you can force-cast it (not recommended).

@founderblocks-sils
Copy link

@szmarczak how would such a workaround look like? Having the same issue here.

@meotimdihia
Copy link

@szmarczak I still get the error even though I didn't use the .get
image

@barjin barjin assigned barjin and unassigned szmarczak Mar 16, 2023
@vladfrangu
Copy link
Member

This was solved by #88 and will be available in the next release 🎉

@B4nan
Copy link
Member

B4nan commented Mar 17, 2023

This was solved by #88 and will be available in the next release 🎉

This reminds me - please always link the issue from PR so its closed automatically as well as linked in the changelog.

(but I guess we found out "again" about this on slack, right)

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

Successfully merging a pull request may close this issue.

8 participants