Open vanceism7 opened 3 months ago
Hi @vanceism7, thank you for opening this issue, the team will take a look.
Seconding this. To complement:
AppProxyLink
componentAny 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.
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 another