Start the React project and report the following error:
[ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
at validateString (internal/validators.js:120:11)......
There are two possible reasons for this error. The solution is as follows:
The React – Scripts version may be too low. The solution is as follows:
1. In package.json, replace "react-scripts": "^3.3.0" with
"react-scripts": "^3.4.0"
2. Delete the node_modules folder
3. Run cnpm i for a second
2. Modify the config/webpackDevServer. Config. Js file, as follows:
Look at the config/webpackDevServer. Config. Js files have the following code:
app.use(noopServiceWorkerMiddleware());
Modified into
app.use(noopServiceWorkerMiddleware('/'));
Done!