Open
Description
Expected Behavior
- Clone app and install dependencies.
- Plug in variables into
environment.js
. - Run
npm start
. - View "Home" page and test configurations.
Actual Bahavior
After running npm start
, the following error message is displayed:
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
at validateString (internal/validators.js:124:11)
at Object.join (path.js:1148:7)
at noopServiceWorkerMiddleware (/Users/hqu5813/Desktop/appauth-react/node_modules/react-dev-utils/noopServiceWorkerMiddleware.js:14:26)
at Layer.handle [as handle_request] (/Users/hqu5813/Desktop/appauth-react/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/Users/hqu5813/Desktop/appauth-react/node_modules/express/lib/router/index.js:317:13)
at /Users/hqu5813/Desktop/appauth-react/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/Users/hqu5813/Desktop/appauth-react/node_modules/express/lib/router/index.js:335:12)
at next (/Users/hqu5813/Desktop/appauth-react/node_modules/express/lib/router/index.js:275:10)
at launchEditorMiddleware (/Users/hqu5813/Desktop/appauth-react/node_modules/react-dev-utils/errorOverlayMiddleware.js:20:7)
at Layer.handle [as handle_request] (/Users/hqu5813/Desktop/appauth-react/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/Users/hqu5813/Desktop/appauth-react/node_modules/express/lib/router/index.js:317:13)
at /Users/hqu5813/Desktop/appauth-react/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/Users/hqu5813/Desktop/appauth-react/node_modules/express/lib/router/index.js:335:12)
at next (/Users/hqu5813/Desktop/appauth-react/node_modules/express/lib/router/index.js:275:10)
at handleWebpackInternalMiddleware (/Users/hqu5813/Desktop/appauth-react/node_modules/react-dev-utils/evalSourceMapMiddleware.js:42:7)
at Layer.handle [as handle_request] (/Users/hqu5813/Desktop/appauth-react/node_modules/express/lib/router/layer.js:95:5)
The App.js
file already passes parameters to the path
attribute as a string.
<div>
<Route exact path="/" component={Home} />
<Route exact path="/profile" component={Profile} />
<Route exact path="/callback" component={Callback} />
</div>
Possible Fix
According to a StackOverflow article - https://stackoverflow.com/questions/60234640/typeerror-err-invalid-arg-type-the-path-argument-must-be-of-type-string-re - the error is caused because of an out-of-date version of react-scripts
.
Steps Taken to Resolve Issue
rm -rf node_modules
.- Bump
react-scripts
version inpackage.json
:
"dependencies": {
. . .
"react-scripts": "3.4.0" // Edit from "3.3.0" to 3.4.0.
},
- Run
npm i
to reinstall dependencies. - Run
npm start
.
Metadata
Metadata
Assignees
Labels
No labels