Shopify / shopify-app-bridge

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

App bridge modal loads the app twice #436

Open nullndr opened 2 months ago

nullndr commented 2 months ago

Setup the shopify remix.run template and run npm run dev, open the navigation tab and you will see just one of each request:

Image

Now adds a <ui-modal/> on the the app._index.ts file, like:

return (
  <Page>
    <TitleBar title="Remix app template">
      <button variant="primary" onClick={generateProduct}>
        Generate a product
      </button>
    </TitleBar>
    <BlockStack gap="500">
      <ui-modal id="foo"></ui-modal>
      ...
    </BlockStack>
  </Page>
);

Clear the navigation logs and reload the page, you will now see each request made twice:

Image

nullndr commented 2 months ago

Sorry I wanted to open this issue in the app bridge repo, can some admin move this?