-
Notifications
You must be signed in to change notification settings - Fork 36
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
fix(preview): fix router when deployed on subpath #252
fix(preview): fix router when deployed on subpath #252
Conversation
Running the code as-is with your method for testing worked successfully. Is it only when deployed beyond localhost that it fails? I'm looking for the conditions needed for the code to fail as it is in main, since that's the only way we can protect against regressions here. |
This comment was marked as outdated.
This comment was marked as outdated.
Strange, that's what I used to test and it worked here. |
Just found that
When i updated the But the react-router is still configured incorrectly, when you click on any of the templates you will see that it creates an incorrect path This PR is fixing this. Currently, you assign only the root path in the router to the basepath. |
Thoughts: Using a path based navigation It's possible to achieve more self-contained / deployment-proof artifact if you will use hash based navigation instead:
This approach is used in the playwright reports, for example. Also this approach allow deploying without an explicit specifying a |
Good catch.om the url. Will give this some thoughts today and act on it tonight. |
Played around a bit with this. I'm liking the pattern of |
Using |
After implementing |
@timofei-iatsenko v2.4.0 is out and should tackle the concerns in this PR. (I haven't removed the base path flag yet) |
@shellscape thanks, also |
Component / Package Name:
This PR contains:
Are tests included?
Breaking Changes?
If yes, please include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.
List any relevant issue numbers: #245
This PR fixes an incorrect setting introduced here #247
Description
The preview still doesn't work when deployed on the subpath. Assets are loaded but router configured incorrectly and returns Route not Found error
I'm filling a bit guilty, because I proposed this solution, but actually i didn't test it and speculated only looking to the code on the github. It turned out that the basepath should go into the
basename
router parameter.