Shopify / shopify-app-bridge

https://shopify.dev/docs/api/app-bridge
86 stars 9 forks source link

App bridge loading does not always work #237

Open resistorsoftware opened 1 year ago

resistorsoftware commented 1 year ago

Describe the bug

I can press a button that invokes some Javascript, and that in turn fires off a

shopify.loading(true)

But the progress loading bar never loads.

To Reproduce

async function getStuff (search) {
  shopify.loading(true)
  const response = await post(`/stuff`, {
    responseKind: "turbo-stream", 
    contentType: "text/vnd.turbo-stream.html", 
    query: search
  })
  if (response.ok) {
    shopify.loading(false)
    flashNotice("Search from completed")
  } else {
    console.log("Returned from search badly")
    flashNotice("Search Error happened")
  }
}

I call a function like that on a button press.

Expected behaviour

I expect the loading bar to progress. It does, sometimes. Not all the time.

Contextual information

Embedded App in Shopify store. Nothing unusual going on. Just a button click that calls a function, that should start/stop a loading progress bar.

Packages and versions

List the relevant packages you’re using, and their versions. For example:

https://cdn.shopify.com/shopifycloud/app-bridge.js

Platform

MacOS, Rails 7, Stimulus

henrytao-me commented 1 year ago

@resistorsoftware can I know which app it is?

resistorsoftware commented 1 year ago

It is one I am actively developing. So it runs in my development stores, as localhost, and in my clients production Shopify store as a cloud-based production App. Nothing in App store. It is a Custom App.

uurcank commented 1 year ago

@resistorsoftware could this be the reason?

darrynten commented 10 months ago

It could be that your internet connection is too slow and the CDN version isn't being loaded quickly enough

Would not be a problem with locally installable versioned npm releases