Skip to content

Stripe script onLoaded function not being called  #232

Closed
@AdamBD

Description

@AdamBD

🐛 The bug

I am trying the basic implementation example from the documentation.

<template>
  <div ref="paymentEl" />
</template>

<script setup>
  const paymentEl = ref(null)
  const { onLoaded } = useScriptStripe()
  onMounted(() => {
    onLoaded(async ({ Stripe }) => {
    alert("Callback was called")
      const stripe = Stripe(
        "pk_live_5....",
      )
    })
  })
</script>

The onLoaded function does not seem to be working as the callback function is never being called

🛠️ To reproduce

https://stackblitz.com/edit/nuxt-starter-wozyte?file=pages%2Findex.vue,pages%2Fjs-confetti.vue

🌈 Expected behavior

I expect my callback function to be called by onLoaded

ℹ️ Additional context

image
I see these warnings from the stripe SDK, maybe this is causing errors that lead to the callback function not being called?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions