Ionic-framework: bug: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined

Created on 16 Feb 2020  ·  10Comments  ·  Source: ionic-team/ionic-framework

Bug Report

Ionic version:


[x] 5.0.0

Current behavior:
As soon as I create a new Ionic React app get the following: error.

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at validateString (internal/validators.js:118:11)
    at Object.join (path.js:1039:7)
    at noopServiceWorkerMiddleware (/home/yunier/soft-dev/billmeapp/node_modules/react-dev-utils/noopServiceWorkerMiddleware.js:14:26)
    at Layer.handle [as handle_request] (/home/yunier/soft-dev/billmeapp/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/yunier/soft-dev/billmeapp/node_modules/express/lib/router/index.js:317:13)
    at /home/yunier/soft-dev/billmeapp/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/home/yunier/soft-dev/billmeapp/node_modules/express/lib/router/index.js:335:12)
    at next (/home/yunier/soft-dev/billmeapp/node_modules/express/lib/router/index.js:275:10)
    at launchEditorMiddleware (/home/yunier/soft-dev/billmeapp/node_modules/react-dev-utils/errorOverlayMiddleware.js:20:7)
    at Layer.handle [as handle_request] (/home/yunier/soft-dev/billmeapp/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/yunier/soft-dev/billmeapp/node_modules/express/lib/router/index.js:317:13)
    at /home/yunier/soft-dev/billmeapp/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/home/yunier/soft-dev/billmeapp/node_modules/express/lib/router/index.js:335:12)
    at next (/home/yunier/soft-dev/billmeapp/node_modules/express/lib/router/index.js:275:10)
    at handleWebpackInternalMiddleware (/home/yunier/soft-dev/billmeapp/node_modules/react-dev-utils/evalSourceMapMiddleware.js:42:7)
    at Layer.handle [as handle_request] (/home/yunier/soft-dev/billmeapp/node_modules/express/lib/router/layer.js:95:5)

Expected behavior:
Able to create a new Ionic React app.

Steps to reproduce:
Create a new Ionic React app.

Related code:
ionic start <appname> --type='react'

Other information:

Just to double-check, create a new Ubuntu VM and installed node.js ionic and run ionic start <appname> --type="react" and still got the same error. If I use angular I got no issue.

Ionic info:

Ionic:

   Ionic CLI       : 6.1.0 (/usr/local/share/.config/yarn/global/node_modules/@ionic/cli)
   Ionic Framework : @ionic/react 5.0.0

Capacitor:

   Capacitor CLI   : 1.5.0
   @capacitor/core : 1.5.0

Utility:

   cordova-res : not installed
   native-run  : not installed

System:

   NodeJS : v13.8.0 (/home/yunier/.nvm/versions/node/v13.8.0/bin/node)
   npm    : 6.13.6
   OS     : Linux 5.3
triage

Most helpful comment

Hi, upgrading react-scripts package from v3.3.0 to v3.4.0 solved the issue.

More info here:
https://github.com/facebook/create-react-app/issues/8490

All 10 comments

Hi, upgrading react-scripts package from v3.3.0 to v3.4.0 solved the issue.

More info here:
https://github.com/facebook/create-react-app/issues/8490

Thanks for the issue. I am going to close this as this is an issue with a starter dependency, not the framework. I will look into getting https://github.com/ionic-team/starters/pull/1137 merged.

Thanks! working now.

Thanks. My project is running again.

How can I fix an error when react-scripts was ejected?

When react-scripts was ejected :

I downgrade react-dev-utils to 10.0.0 and I work for me.

npm remove react-dev-utils && npm i [email protected]

https://www.gitmemory.com/issue/facebook/create-react-app/8499/588591098

removing and reinstalling react-dev-utils fixed the problem for me

Downgrade react-dev-utils solved my problem.... Thank you ...

npm remove react-dev-utils && npm i [email protected]

Downgrade react-dev utils solve the problem.

npm remove react-dev-utils && npm i [email protected]

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Was this page helpful?
0 / 5 - 0 ratings