-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Trailing slash causes redirect loop #7529
Comments
This should be resolved via #9695 and available in the next release 👍 |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
same issue here |
What version of Remix are you using?
2.0.0
Are all your remix dependencies & dev-dependencies using the same version?
Steps to Reproduce
app/routes/folder.file._index.tsx
(URL path/folder/file
)https://www.example.com/folder/file
)remix.config.js
to setpublicPath = "/folder/file/build/
so assets link through the reverse proxyhttps://example.myshopify.com/folder/file
) which reverse proxies towww.example.com
https://www.example.com/folder/file/
)Initial URL (/folder/file/) does not match URL at time of hydration (/folder/file), reloading page...
Expected Behavior
Expect the refresh behavior to realize that a trailing slash should be ignored.
Temporary fix is to place the following in
entry.client.tsx
:Actual Behavior
Refresh doesn't realize the two paths are effectively the same.
UPDATE: It turns out this is also an issue with links and causes the inverse issue. The
Link
will have a path such as/folder/file
and the path in the browser becomes/folder/file/
, which I believe is updated by the router. I've updated the script that fixes this (above). I've also updated the steps to reproduce to call out that we are using a custompublicPath
.The text was updated successfully, but these errors were encountered: