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

Possible regression in @types/request-promise-native 1.10.12 ? #23291

Closed
jbreckmckye opened this issue Jan 30, 2018 · 4 comments
Closed

Possible regression in @types/request-promise-native 1.10.12 ? #23291

jbreckmckye opened this issue Jan 30, 2018 · 4 comments

Comments

@jbreckmckye
Copy link

jbreckmckye commented Jan 30, 2018

FAO @gustavohenke

I'm using request-promise-native 1.0.5. When I tried using @types/request-promise-native 1.0.12 I saw the following compile error:

Property '[Symbol.toStringTag]' is missing in type 'RequestPromise'.

I think TSC believes request-promise-native is returning a "Promise-like" rather than a Promise.

This issue does not exist with @types/request-promise-native 1.0.10

@GooSP
Copy link

GooSP commented Jan 30, 2018

Same problem here with request-promise-native 1.0.5. Downgrading typing to 1.0.10 works.

@gustavohenke
Copy link
Contributor

See #23087, cc @mastermatt

@mastermatt
Copy link
Contributor

mastermatt commented Jan 31, 2018

This is correct, request-promise-native does not return a Promise.
Check the PR linked above for a description and links to relevant code.

    const rp = requestPromise.get("http://github.com");
    console.log(typeof rp); // object
    console.log(Object.prototype.toString.call(rp)); // [object Object]
    console.log(rp.toString()); // [object Object]
    console.log(rp.toStringTag); // undefined
    console.log(rp.promise().toString()); // [object Promise]

If you need access to the underlying Promise, use rp.promise().

@orta
Copy link
Collaborator

orta commented Jun 7, 2021

Hi thread, we're moving DefinitelyTyped to use GitHub Discussions for conversations the @types modules in DefinitelyTyped.

To help with the transition, we're closing all issues which haven't had activity in the last 6 months, which includes this issue. If you think closing this issue is a mistake, please pop into the TypeScript Community Discord and mention the issue in the definitely-typed channel.

@orta orta closed this as completed Jun 7, 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

5 participants