Definitelytyped: [@types/stripe 6.30.7 and later]

Created on 17 Jul 2019  路  11Comments  路  Source: DefinitelyTyped/DefinitelyTyped

If you know how to fix the issue, make a pull request instead.

  • [x] I tried using the @types/xxxx package and had problems.
  • [x] I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript
  • [x] I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).
  • [x] [Mention](https://github.com/blog/821-mention-somebody-they-re-notified) the authors (see Definitions by: in index.d.ts) so they can respond.

    • Authors: @wjohnsto @CodeAnimal @sampsonjoliver @LinusU @brannon @kkamperschroer @starhoshi @bruun @galtalmor @htunnicliff @squirly @tzarger @ifiokjr @yultyyev @cpsoinos @adamduren @saranshkataria @0xJoKe @delianides @gokulchandra @viralpickaxe @chrisleck @spacetag

If I try to compile my project with @types/stripe 6.30.7 or later I get the following error:

node_modules/@types/stripe/index.d.ts:6995:58 - error TS2304: Cannot find name 'AsyncIterableIterator'.

6995     interface IListPromise<T> extends Promise<IList<T>>, AsyncIterableIterator<T> {

It can be found on line 7376 here: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/stripe/index.d.ts#L7376

Most helpful comment

@arjunyel Looks like that works, one thing for anyone trying to implement this with Firebase Functions you'll need to install @types/node which doesn't come with the project by default.

All 11 comments

my build is broken right now because of this issue... Any updates/workarounds?

For anyone else experiencing this issue, 6.30.6 is their latest working version

In your tsconfig.json in the lib option try adding "lib": ["esnext.asynciterable"]

@arjunyel Looks like that works, one thing for anyone trying to implement this with Firebase Functions you'll need to install @types/node which doesn't come with the project by default.

Im happy to help :D I think this can be closed since its a Typescript setting, not a bug with the types

I think someone from the TypeScript team should take a look at this before closing, I'm not sure what the policy/stance is on using things that requires non-standard libs settings 馃

They've also got the tiers wrong for IPlanCreateOptions, in the docs its
image

but in their index.d.ts it's

image

EDIT

I created and merged a PR to fix this

Hey,

Even with the suggestions made here, namely:

  1. Added the option esnext.asynciterable to the lib section of tsconfig.json
  2. Make sure I had @types/node (version 12.7.0)
  3. Using a recent typescript version (3.5.3)

I cannot get this to work, it fails on the typescript definitions of stripe:

node_modules/@types/stripe/index.d.ts(7687,15): error TS2320: Interface 'IListPromise<T>' cannot simultaneously extend types 'Promise<IList<T>>' and 'AsyncIterableIterator<T>'.
  Named property 'return' of types 'Promise<IList<T>>' and 'AsyncIterableIterator<T>' are not identical.

Which seems a bit different from the error the OP was having. Any clues?

@jcristovao I had the same error, I resolved it by uninstalling the "@types/bluebird-global" package.

Just want to mention that this fix also works for @types/stripe-v3: 3.1.9

Was this page helpful?
0 / 5 - 0 ratings