Shopify / shopify-app-bridge

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

App-bridge cnd breaks npm app-bridge navigation menu #267

Closed PhiloNL closed 5 months ago

PhiloNL commented 6 months ago

Describe the bug

I've been using both versions of app bridge, @shopify/app-bridge and. cdn.shopify.com/shopifycloud/app-bridge.js. The CDN version I use for Toast and the resource picker. The NPM version I use for creating a navigation menu (actions.NavigationMenu.create()). This has always worked fine.

Starting this evening, the navigation menu renders but the links no longer work.

To Reproduce

  1. Launch an app that uses both the NPM and CDN app-bridge but uses the npm package to build the navigation using:
     const navigationMenu = actions.NavigationMenu.create(app, {
            items: [ /... ]
        });
  2. Navigate between pages and notice the page does not change.

Expected behaviour

It should navigate between pages that I click in the navigation menu.

Contextual information

Can we please get a CDN-versioned app bridge like the NPM package?

Packages and versions

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

Platform

PRS03 commented 5 months ago

+1

ryanrphillips commented 5 months ago

Did you confirm that the issue is caused by loading the CDN version of app bridge alongside the NPM version? There was an issue with the sidebar navigation yesterday that appears to have been resolved about 10 hours ago.

cc @henrytao-me

PhiloNL commented 5 months ago

@ryanrphillips I just gave it another try and the issue still persists, unfortunately.

One issue seems to be resolved though; when you clicked the app itself in the sidebar from an app subpage it would not go to the root page.

panzerdp commented 5 months ago

One issue seems to be resolved though; when you clicked the app itself in the sidebar from an app subpage it would not go to the root page.

Seems like the problem still persists. On many apps clicking on the app icon on the sidebar from a subpage does not navigate to the root page of the app.

neoanic commented 5 months ago

+1

AgneshV commented 5 months ago

I've also faced the same issue, When I click on the app itself in the sidebar from an app subpage it does not go to the root page. Have any solution for this?

henrytao-me commented 5 months ago

I've also faced the same issue, When I click on the app itself in the sidebar from an app subpage it does not go to the root page. Have any solution for this?

A fix for this should be merged soon. It's a separate issue.

henrytao-me commented 5 months ago

While we recommend to use Navigation Menu in App Bridge CDN, if you still want to use it from npm version, you need to disable it in App Bridge CDN. You can do it via meta tag

<meta name="shopify-disabled-features" content="navigation-menu" />

See https://shopify.dev/docs/api/app-bridge-library/reference/config#setting-config-values-disabledfeatures

panzerdp commented 5 months ago

@henrytao-me

A fix for this should be merged soon. It's a separate issue.

Thank you for the update.

But can you give an estimate when the bug is going to be fixed & merged? It passed 17 hours, and I still can see many apps, including mine, are having this problem.

Update: the issue has been resolved.

luizfaro commented 2 months ago

While we recommend to use Navigation Menu in App Bridge CDN, if you still want to use it from npm version, you need to disable it in App Bridge CDN. You can do it via meta tag

<meta name="shopify-disabled-features" content="navigation-menu" />

See https://shopify.dev/docs/api/app-bridge-library/reference/config#setting-config-values-disabledfeatures

Hello @henrytao-me !

Is there a list of possible values for the "shopify-disabled-features" meta tag? I am using AppBridge both CDN and npm package (as per https://github.com/Shopify/shopify-app-bridge/issues/194#issuecomment-2035257323), and I would like to disable the CDN features I have not yet migrated from the npm version...

Thank you!