#gregorysam-subs
1 messages · Page 1 of 1 (latest)
@regal flax hi! What's the error exactly? the code looks normal enough, all I see are warnings , not errors
yarn run v1.22.11
warning ../../../../../../package.json: No license field
$ npm run build && node build/index.js
typescript-starter@1.0.0 build
rimraf ./build && tsc
src/index.ts:658:23 - error TS2531: Object is possibly 'null'.
658 paymentIntent: subscription.latest_invoice.payment_intent,
~~~~~~~~~~~~~~~~~~~~~~~~~~~
`src/index.ts:658:51 - error TS2339: Property 'payment_intent' does not exist on type 'string | Invoice'.
Property 'payment_intent' does not exist on type 'string'.
658 paymentIntent: subscription.latest_invoice.payment_intent,
~~~~~~~~~~~~~~
src/index.ts:659:22 - error TS2531: Object is possibly 'null'.
659 clientSecret: subscription.latest_invoice.payment_intent.client_secret,
~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/index.ts:659:50 - error TS2339: Property 'payment_intent' does not exist on type 'string | Invoice'.
Property 'payment_intent' does not exist on type 'string'.
659 clientSecret: subscription.latest_invoice.payment_intent.client_secret,
~~~~~~~~~~~~~~
Found 4 errors.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.`
also i can send you what subscription prints if that helps
Property 'payment_intent' does not exist on type 'string | Invoice'.
Property 'payment_intent' does not exist on type 'string'.
hmm
what type bindings are you using?
maybe you're using something unofficial or old, our official types should support this : https://github.com/stripe/stripe-node/blob/master/types/2020-08-27/Invoices.d.ts#L242-L245
I dont know anything about node i am new to it
i am using stripe 8.0.1