-
Notifications
You must be signed in to change notification settings - Fork 724
Description
Issue summary
Before opening this issue, I have:
- [x ] Upgraded to the latest version of the package
shopify_appversion: 22.4.0- Ruby version: 3.3.1
- Operating system: Mac OS X Sonoma 14.6.1
- [x ] Set
log_level: :debugin my configuration, if applicable - [x ] Found a reliable way to reproduce the problem that indicates it's a problem with the package
- [x ] Looked for similar issues in this repository
- [x ] Checked that this isn't an issue with a Shopify API
- If it is, please create a post in the Shopify community forums or report it to Shopify Partner Support
Using Shopify App with app-bridge v.4, any relative links from Polaris components (Link, Button, etc) are opening in a new tab, and not using the proper shopify admin store URL.
Using the boilerplate Ruby shopify app from the app template (https://github.com/Shopify/shopify-app-template-ruby), I create a Polaris link like this: <Link url="/pagename">Click Me</Link> and then click the link.
Expected behavior
Clicking the polaris Link element above should change browser URL to: https://admin.shopify.com/store/mystore/apps/my-app/pagename (not opening new tab)
Actual behavior
Clicking the link opens a new tab, with URL: https://<cloudflare-tunnel-host>/pagename.
This URL is not using the shopify store URL at all -- it is just using the underlying Rails host name. It seems to be totally bypassing the React router.
This worked fine with App Bridge V3 --- since in the PolarisProvider.jsx class, it was using the AppBridge navigate() method. Now with AppBridge v4, that same class is now calling window.open(url) which ends up opening a new tab.
Steps to reproduce the problem
- Create a new Shopify App (ruby) using the Shopify App Template for Ruby
- Add a Polaris
Linkelement to an internal app page (e.g./pagename) - Click the link in the app UI