-
Notifications
You must be signed in to change notification settings - Fork 124
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
[shopify-app-remix] Form submissions redirects broken in proxied remix app #1073
Comments
Hi @vanceism7, thank you for opening this issue, the team will take a look. |
Seconding this. To complement:
|
Any progress with the findings? This really gives me headaches.. |
We're labeling this issue as stale because there hasn't been any activity on it for 60 days. While the issue will stay open and we hope to resolve it, this helps us prioritize community requests. You can add a comment to remove the label if it's still relevant, and we can re-evaluate it. |
We're labeling this issue as stale because there hasn't been any activity on it for 60 days. While the issue will stay open and we hope to resolve it, this helps us prioritize community requests. You can add a comment to remove the label if it's still relevant, and we can re-evaluate it. |
Hi there 👋 Sorry for the delay on this. A couple of things
Yes, this is a known issue with Remix unfortunately. At this time there are a couple of options.
Yes, because you are using the Remix redirect it is redirecting based on your app URL. I will create a ticket for us to explore adding a redirect helper to the App Proxy context (similar to what we do for the Admin context), that could allow for specifying redirects how you describe in the expected. For the time being if you want to redirect to a different URL on the shop, you will need to specify the entire path. I will be making some updates to the documentation with some more of this context. |
One more thing i'd like to discuss , As clearly mentioned in the docs , merchants can change the url this means the form will break. Is there any way to get the proxy URL? |
I don't believe at this time there is a way. I would recommend you ask that question in the Community Forums. That will route the question the to the team that owns the App Proxy feature in the platform, and go into their tracking. |
This question was asked 10 years ago and still gets attention today. It would be great to improve this, as the app proxy experience isn't very good right now. |
I agree this is something that there should be a better experience. If you create a new question in the new developer community I can try to bump that with the team that owns App Proxy. |
Thank you!. I’ve created a new question https://community.shopify.dev/t/getting-proxy-url-from-an-installed-shop/3558. Looking forward to any updates or guidance on this! |
Issue summary
Before opening this issue, I have:
@shopify/*
package and version:I'm working on a shopify remix app, which is using the shopify proxy on the store front side of things to add some additional functionality. In my work, I think I've discovered that form submission actions seem to be broken because of the proxy url rewrites.
Here's my minimal reproduction
Expected behavior
null
, I expect the page to remain unchangedredirect("/")
- I expect the page to go back to my store front url, e.g:foo.myshopify.com
redirect("/apps/proxy/foo")
- I expect the page to redirect tofoo.myshopify.com/apps/proxy/foo
- i.e: the url should be unchangedActual behavior
In all of the above expected scenarios, instead of the page remaining unchanged or redirecting properly, the store url always gets rewritten to the url of my actual app.
E.g: (If my app url is
myapp.com
)null
redirects me tomyapp.com/apps/proxy/foo
(the url is unchanged exceptfoo.myshopify.com
becomesmyapp.com
)redirect("/")
redirects me tomyapp.com
instead offoo.myshopify.com
redirect("/apps/proxy/foo")
redirects me tomyapp.com/apps/proxy/foo
instead offoo.myshopify.com/apps/proxy/foo
Other notes
This issue seems to specifically happen with form submission actions.
For example, the following loader function works as expected
This function will successfully redirect me to
foo.myshopify.com
.Also, if I call the action function manually using a
fetch
call, this also gets back the response fine without any redirection.But any call within the context of a form submission redirects away from the shopify store over to my app's direct url. This is specifically a big issue when using libs like
conform
, which use the form action to run validation on the server side, causing the form to break immediately on tabbing from one form input to anotherThe text was updated successfully, but these errors were encountered: