question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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 issue

Describe 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:)

  1. install react-scripts 3.2.0
  2. set homepage:"/my/dir" in package.json
  3. add <Link to="/about">About</Link> from react-router to the project
  4. npm start
  5. 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:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
jamespleasecommented, Feb 21, 2020
0reactions
stale[bot]commented, Mar 29, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Upgrade to React 18
Updates to Client Rendering APIs. When you first install React 18, you will see a warning in the console: ReactDOM.render is no longer...
Read more >
create-react-app my-app takes 2 - 2.5 hours? Any idea why?
Any advice would be much appreciated. Edit: I have 300 MBPS. It's not a wifi thing. Node version is 14.17.3 and npm is...
Read more >
Upgrading Guide - Keycloak
This guide describes how to upgrade Keycloak. It is recommended that you start by upgrading the Keycloak server first and Keycloak adapters ...
Read more >
Package List — Spack 0.20.0.dev0 documentation
This is a list of things you can install using Spack. It is automatically generated based on the packages in this Spack version....
Read more >
router cannot be used as a jsx component - You.com | The search ...
I would like to comment but I dont have enough reputation, But as your error code is saying you are not return anything...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found