-
Notifications
You must be signed in to change notification settings - Fork 392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React hook useNavigate() redirects to the wrong url #1283
Comments
I'm seeing the same problem here. A workaround is to submit the URL without "store/{storeName}", but that might be incompatible if this bug eventually gets fixed. |
@greentfrapp Yes i thought of that. But this will just make the situation worse! |
I tested this on app that i published a month ago, and didn't update for more than a week. It was working fine and merchants were getting redirected to the charge url, but now it have the same issue too! |
The issue happens when you have your app opened on url: https://admin.shopify.com/store/somestore/apps/someapp. In short, yes, the issue is happening on the first case. Basically it doubles part of url unnecessary, making the whole url invalid., e.g.: It doubled: "store/somestore/store/somestore" |
Same issue here for navigating to an admin url from inside an embedded app. Totally unexpected as I have not changed versions. Pretty unfortunate bug to be honest as I was using it to navigate to a RecurringApplicationCharge and this is causing my onboarding flow to drop off and loose sales. In my case of an embedded app trying to navigate to an admin url, I found a workaround using window.parent : // Logic to get some shopify admin url from within embedded app
const confirmationUrl = await appSubscriptionCreate()
//https://admin.shopify.com/store/storeName/charges/00000/00000/RecurringApplicationCharge/confirm_recurring_application_charge?signature=00000--00000
// Since embedded app is in an iframe, access the parent of the frame and navigate it's location.href
window.parent.location.href = confirmationUrl; |
Update - this seems to be fixed already. I was able to navigate to the subscription page from the embedded app via |
Closing because this seems to be fixed. Please create a new ticket if you are still seeing issues. |
Issue summary
@shopify/shopify-app-express
version: 2.0.0@shopify/app
version: 3.46.5@shopify/cli
version: 3.46.5Expected behavior
useNavigate() should redirect to URL: https://admin.shopify.com/store/storeName/charges/00000/00000/RecurringApplicationCharge/confirm_recurring_application_charge?signature=00000--00000
Actual behavior
useNavigate() is redirecting to URL: https://admin.shopify.com/store/storeName/store/storeName/charges/00000/00000/RecurringApplicationCharge/confirm_recurring_application_charge?signature=00000--00000
The hook adds an unnecessary /store/storeName/ to the original url.
This was working fine until today.
I tried other urls like google.com and it works fine.
I tried uninstalling the app, i tried it on production, it's not working!
Steps to reproduce the problem
The text was updated successfully, but these errors were encountered: