App reviews, troubleshooting, and recommendations
I create Admin App on Angular 19. SPA with routing.
I want to add navigation menu in admin panel on merchant store.
For example menu with two items
Dashboard
Settings
in npm I install @Shopify/app-bridge
1. create app-bridge
this.app = createApp({ apiKey: 'SHOPIFY_API_KEY', host: host });
2. create NavigationMenu with items
const dashboardLink = AppLink.create(this.app, {
label: 'Dashboard',
destination: '/',
});
const settingsLink = AppLink.create(this.app, {
label: 'Settings',
destination: '/settings',
});
this.menu = NavigationMenu.create(this.app, {
items: [dashboardLink, settingsLink],
})
after some timeout add menu to App
setTimeout(() => { this.app.dispatch(this.menu); }, 500);
but I catch exeption
TypeError: Cannot read properties of undefined (reading 'items') at getPayloadSchema (menu.js:48:23) at Object.validateAction (menu.js:72:85) at dispatchPayloadValidator (validator.js:51:29) at dispatchValidator (validator.js:90:23) at Object.<anonymous> (validator.js:113:23) at handler (Hooks.js:89:38) at Object.<anonymous> (Client.js:54:12) at Object.handler (Hooks.js:89:38) at Hooks2.run (Hooks.js:93:20) at Object.dispatch (Client.js:142:26)
despite this the menu appears in the admin panel
And secont question
when I navigating by menu item my browser URL is changing according 'destination'. But my SPA routing in Angular does not load the corresponding component. Internal iframe not "feel" of URL changing. How to create menu that will change routing is SPA but not in the browser URL
Solved! Go to the solution
This is an accepted solution.
The problem was
setTimeout(() => { this.app.dispatch(this.menu); }, 500);
There no need to dispatch menu to add it on admin panel.
creating a NavigationMenu is enough
this.menu = NavigationMenu.create(this.app, {
items: [dashboardLink, settingsLink],
})
But the second problem remains
The NavigationMenu does not switch routes inside the SPA application!
This is an accepted solution.
The problem was
setTimeout(() => { this.app.dispatch(this.menu); }, 500);
There no need to dispatch menu to add it on admin panel.
creating a NavigationMenu is enough
this.menu = NavigationMenu.create(this.app, {
items: [dashboardLink, settingsLink],
})
But the second problem remains
The NavigationMenu does not switch routes inside the SPA application!
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025