Upgrading react-scripts from 3.2.0 to 3.4.0 will cause routing URL behave differently when "homepage" is set in Dev mode
See original GitHub issueDescribe the bug
Upgrading react-scripts from 3.2.0 to 3.4.0 will cause routing URL behave differently when “homepage” is set in Dev mode.
With hompage:"/my/dir"
set in my package.json
and using React router component <Link to="/about">About</Link>
to do the routing, different version will have different behavior on the url generated in <a href="xxx">
:
v3.2.0
-> <a href="/about">
v3.4.0
-> <a href="/my/dir/about">
But it seems to be only affecting dev version of the application, production build is always pointing to <a href="/my/dir/about">
Did you try recovering your dependencies?
Yes
Which terms did you search for in User Guide?
homepage, react-scripts, 3.4.0, change log
Environment
(paste the output of the command here.)
Steps to reproduce
(Write your steps here:)
- install react-scripts 3.2.0
- set
homepage:"/my/dir"
inpackage.json
- add
<Link to="/about">About</Link>
from react-router to the project npm start
- inspect this element in browser, it will have different href in different react-scripts version
v3.2.0
-><a href="/about">
v3.4.0
-><a href="/my/dir/about">
Expected behavior
Should behave the same as the previous version.
Actual behavior
Inspect this element in browser, it will have different href in different react-scripts version
v3.2.0
-> <a href="/about">
v3.4.0
-> <a href="/my/dir/about">
Reproducible demo
(Paste the link to an example project and exact instructions to reproduce the issue.)
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top GitHub Comments
This comment may help you @tkforce
This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue.