首页 > 解决方案 > 开发服务器在 React 中给出错误:TypeError [ERR_INVALID_ARG_TYPE]:“路径”参数必须是字符串类型。收到未定义

问题描述

运行我的 React 开发服务器几次后我得到一个错误,以前我运行这个项目没有得到这样的错误,几个月后重新启动这个项目我得到一个这样的错误。我该如何解决这个错误?

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at validateString (internal/validators.js:122:11)
    at Object.join (path.js:375:7)
    at noopServiceWorkerMiddleware (C:\xampp\htdocs\wms-react-template\node_modules\react-dev-utils\noopServiceWorkerMiddleware.js:14:26)
    at Layer.handle [as handle_request] (C:\xampp\htdocs\wms-react-template\node_modules\express\lib\router\layer.js:95:5)
    at trim_prefix (C:\xampp\htdocs\wms-react-template\node_modules\express\lib\router\index.js:317:13)
    at C:\xampp\htdocs\wms-react-template\node_modules\express\lib\router\index.js:284:7
    at Function.process_params (C:\xampp\htdocs\wms-react-template\node_modules\express\lib\router\index.js:335:12)
    at next (C:\xampp\htdocs\wms-react-template\node_modules\express\lib\router\index.js:275:10)
    at launchEditorMiddleware (C:\xampp\htdocs\wms-react-template\node_modules\react-dev-utils\errorOverlayMiddleware.js:20:7)
    at Layer.handle [as handle_request] (C:\xampp\htdocs\wms-react-template\node_modules\express\lib\router\layer.js:95:5)

标签: reactjs

解决方案


推荐阅读