#gregorysam-subs

1 messages · Page 1 of 1 (latest)

undone gorge
#

@regal flax hi! What's the error exactly? the code looks normal enough, all I see are warnings , not errors

regal flax
#

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'.

undone gorge
#

hmm

#

what type bindings are you using?

regal flax
#

I dont know anything about node i am new to it
i am using stripe 8.0.1

undone gorge
#

well I'd start by upgrading to the latest version at least!

#

8.0.1 is from early 2020. You can safely upgrade to the latest, it's all the 8.x.x. release.