-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Initial URL (/) does not match URL at time of hydration (/h5/), reloading page... #6785
Comments
Can you provide a minimal reproduction of this issue? Remix does not support the concept of a |
The reloading and error message is the same as when dependencies of |
I'm going to close this since we don't have a reproduction, but please re-open if you are able to put one together! |
@brophdawg11 I'm able to reproduce the reported behavior with the following:
Both proxies seem to work but the page keeps getting refreshed looping through the page content and a 404 Not Found (as exhibited in the sshots below). Any hints on how I can work around this behavior? Thank you |
Remix does not support URL rewriting, you'll need to make your remix app run for the full URL |
Not working: middleware-layer URL rewrites do not work with Remix. The backend and frontend URLs have to match exactly. See remix-run/remix#6785 (comment)
Has anyone got solution to this? |
I need this as well. Would like to use this with Shopify, but need the support for URL rewriting: https://shopify.dev/docs/api/shopify-app-remix/v2/authenticate/public/app-proxy |
I have a use case that is somewhat related to the mentioned example that I would be curious if it was supported. I'm looking to host parallel sites, where the Remix app is the new site and there is a legacy site that exists. I'm trying to cutover pieces of the legacy site to exist in the remix site as their own URL path to avoid having to cutover entire pages at a time. For example, I have a Remix /footer route that exists that serves only the footer for the remix app and avoids the rest of it (still using root though). I've setup the reverse proxy so that any request that is made to a url would go through the legacy site, and the legacy site fetches HTML from the Remix site using the reverse proxy's base url with /footer. This routes the request to the Remix app successfully. I've also handled loading all additional styles with the reverse proxy. The issue is that when trying to load the page, Remix is trying to hydrate the component that was served from /footer, but the actual client url is just a base url ( / ), and its failing the hydration and triggering a page reload. Is there a way to handle that scenario such that it doesn't care what the client url is for something? |
What version of Remix are you using?
1.18.1
Are all your remix dependencies & dev-dependencies using the same version?
Steps to Reproduce
Deploy the project in the subdirectory /h5
Visit us at http://192.168.1.1/h5/
Browser console error
chunk-YFZWJFVK.js:33 Initial URL (/) does not match URL at time of hydration (/h5/), reloading page...
And the page refreshes indefinitely
Expected Behavior
Be able to access normally
Actual Behavior
Browser console error
chunk-YFZWJFVK.js:33 Initial URL (/) does not match URL at time of hydration (/h5/), reloading page...
And the page refreshes indefinitely
The text was updated successfully, but these errors were encountered: