Repository: create-react-app
Issue: Including # in package.json homepage breaks everything
Labels: needs triage,issue: bug report

### Describe the bug

Including `#` in the homepage field of package.json breaks your app. With an example homepage of `myreactapp#cool`, react tells you that your site is hosted at `localhost:3000/myreactap`. Opening your app leads to a black screen and the following errors:

<details>
  <summary>Stack</summary>

```js
URIError: Failed to decode param '/%PUBLIC_URL%/logo192.png'
    at decodeURIComponent (<anonymous>)
    at decode_param (/home/ven/Projects/Reactulator/node_modules/express/lib/router/layer.js:172:12)
    at Layer.match (/home/ven/Projects/Reactulator/node_modules/express/lib/router/layer.js:123:27)
    at matchLayer (/home/ven/Projects/Reactulator/node_modules/express/lib/router/index.js:574:18)
    at next (/home/ven/Projects/Reactulator/node_modules/express/lib/router/index.js:220:15)
    at expressInit (/home/ven/Projects/Reactulator/node_modules/express/lib/middleware/init.js:40:5)
    at Layer.handle [as handle_request] (/home/ven/Projects/Reactulator/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/ven/Projects/Reactulator/node_modules/express/lib/router/index.js:317:13)
    at /home/ven/Projects/Reactulator/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/home/ven/Projects/Reactulator/node_modules/express/lib/router/index.js:335:12)
URIError: Failed to decode param '/%PUBLIC_URL%/favicon.ico'
    at decodeURIComponent (<anonymous>)
    at decode_param (/home/ven/Projects/Reactulator/node_modules/express/lib/router/layer.js:172:12)
    at Layer.match (/home/ven/Projects/Reactulator/node_modules/express/lib/router/layer.js:123:27)
    at matchLayer (/home/ven/Projects/Reactulator/node_modules/express/lib/router/index.js:574:18)
    at next (/home/ven/Projects/Reactulator/node_modules/express/lib/router/index.js:220:15)
    at expressInit (/home/ven/Projects/Reactulator/node_modules/express/lib/middleware/init.js:40:5)
    at Layer.handle [as handle_request] (/home/ven/Projects/Reactulator/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/ven/Projects/Reactulator/node_modules/express/lib/router/index.js:317:13)
    at /home/ven/Projects/Reactulator/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/home/ven/Projects/Reactulator/node_modules/express/lib/router/index.js:335:12)
```

</details>

I understand that the homepage value is used to deploy to github pages, but if you add a git remote to the project and then use npm init, it will automatically fill the homepage field with `https://github.com/username/repo#README` which causes this bug.

### Did you try recovering your dependencies?
yes

yarn version
> 1.22.5

### Which terms did you search for in User Guide?

N/A

### Environment

<!--
  To help identify if a problem is specific to a platform, browser, or module version, information about your environment is required.
  This enables the maintainers quickly reproduce the issue and give feedback.

  Run the following command in your React app's folder in terminal.
  Note: The result is copied to your clipboard directly.

  `npx create-react-app --info`

  Paste the output of the command in the section below.
-->

```yaml
Environment Info:

  current version of create-react-app: 4.0.1
  running from /home/ven/.npm/_npx/c67e74de0542c87c/node_modules/create-react-app

  System:
    OS: Linux 4.19 Ubuntu 20.04.1 LTS (Focal Fossa)
    CPU: (8) x64 AMD Ryzen 7 3700U with Radeon Vega Mobile Gfx
  Binaries:
    Node: 15.5.1 - /usr/bin/node
    Yarn: 1.22.5 - /usr/bin/yarn
    npm: 7.3.0 - /usr/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: Not Found
  npmPackages:
    react: ^17.0.1 => 17.0.1 
    react-dom: ^17.0.1 => 17.0.1 
    react-scripts: 4.0.1 => 4.0.1 
  npmGlobalPackages:
    create-react-app: Not Found
```

### Steps to reproduce

<!--
  How would you describe your issue to someone who doesn’t know you or your project?
  Try to write a sequence of steps that anybody can repeat to see the issue.
-->

1. Create new app
2. Add a git remote and run npm init -y OR manually add the homepage field with a # in it
3. Run & open your app

### Expected behavior

<!--
  How did you expect the tool to behave?
  It’s fine if you’re not sure your understanding is correct.
  Just write down what you thought would happen.
-->

App should work like normal

### Actual behavior

<!--
  Did something go wrong?
  Is something broken, or not behaving as you expected?
  Please attach screenshots if possible! They are extremely helpful for diagnosing issues.
-->

- Wrong url
- Blackscreen
- No favicon
- Errors in console  
  
![image](https://user-images.githubusercontent.com/45497981/105575220-4cb85f00-5d6a-11eb-934d-62dc0a1b8e8d.png)

![image](https://user-images.githubusercontent.com/45497981/105575345-36f76980-5d6b-11eb-95bf-ec119bea53ff.png)




### Reproducible demo

<!--
  If you can, please share a project that reproduces the issue.
  This is the single most effective way to get an issue fixed soon.

  There are two ways to do it:

    * Create a new app and try to reproduce the issue in it.
      This is useful if you roughly know where the problem is, or can’t share the real code.

    * Or, copy your app and remove things until you’re left with the minimal reproducible demo.
      This is useful for finding the root cause. You may then optionally create a new project.

  This is a good guide to creating bug demos: https://stackoverflow.com/help/mcve
  Once you’re done, push the project to GitHub and paste the link to it below:
-->

N/A

<!--
  What happens if you skip this step?

  We will try to help you, but in many cases it is impossible because crucial
  information is missing. In that case we'll tag an issue as having a low priority,
  and eventually close it if there is no clear direction.

  We still appreciate the report though, as eventually somebody else might
  create a reproducible example for it.

  Thanks for helping us help you!
-->