Repository: create-react-app
Issue: TypeError: dependency.getCondition is not a function
Labels: needs triage,issue: bug report

<!--
    Please note that your issue will be fixed much faster if you spend about
    half an hour preparing it, including the exact reproduction steps and a demo.

    If you're in a hurry or don't feel confident, it's fine to report bugs with
    less details, but this makes it less likely they'll get fixed soon.

    In either case, please use this template and fill in as many fields below as you can.

    Note that we don't provide help for webpack questions after ejecting.
    You can find webpack docs at https://webpack.js.org/.
-->

### Describe the bug
Cannot build the application on the latest version (5.0.0)

### Did you try recovering your dependencies?
Yes.

### Which terms did you search for in User Guide?
N/A

### Environment
```shell
Environment Info:

  current version of create-react-app: 5.0.0
  running from /home/.nvm/versions/node/v16.5.0/lib/node_modules/create-react-app

  System:
    OS: macOS 12.1
    CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
  Binaries:
    Node: 16.5.0 - ~/.nvm/versions/node/v16.5.0/bin/node
    Yarn: Not Found
    npm: 7.19.1 - ~/.nvm/versions/node/v16.5.0/bin/npm
  Browsers:
    Chrome: 96.0.4664.110
    Edge: Not Found
    Firefox: Not Found
    Safari: 15.2
  npmPackages:
    react: ^16.13.1 => 16.14.0 
    react-dom: ^16.13.1 => 16.14.0 
    react-scripts: 5.0.0 => 5.0.0 
  npmGlobalPackages:
    create-react-app: 5.0.0
```
### Steps to reproduce
1. react-scripts start

### Expected behavior
Should build the application with success.

### Actual behavior
```shell
Creating an optimized production build...
(node:40391) [DEP_WEBPACK_COMPILATION_NORMAL_MODULE_LOADER_HOOK] DeprecationWarning: Compilation.hooks.normalModuleLoader was moved to NormalModule.getCompilationHooks(compilation).loader
(Use `node --trace-deprecation ...` to show where the warning was created)
<path>/node_modules/react-scripts/scripts/build.js:19
  throw err;
  ^

TypeError: dependency.getCondition is not a function
    at ModuleGraph.setResolvedModule (<path>/node_modules/react-scripts/node_modules/webpack/lib/ModuleGraph.js:196:15)
    at <path>/node_modules/react-scripts/node_modules/webpack/lib/Compilation.js:1845:20
    at <path>/node_modules/react-scripts/node_modules/webpack/lib/util/AsyncQueue.js:352:5
    at Hook.eval [as callAsync] (eval at create (<path>/node_modules/react-scripts/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (<path>/node_modules/react-scripts/node_modules/tapable/lib/Hook.js:18:14)
    at AsyncQueue._handleResult (<path>/node_modules/react-scripts/node_modules/webpack/lib/util/AsyncQueue.js:322:21)
    at <path>/node_modules/react-scripts/node_modules/webpack/lib/util/AsyncQueue.js:305:11
    at <path>/node_modules/react-scripts/node_modules/webpack/lib/Compilation.js:1299:4
    at <path>/node_modules/react-scripts/node_modules/webpack/lib/Cache.js:85:6
    at <path>/node_modules/react-scripts/node_modules/webpack/lib/Cache.js:39:11
```