Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined #20503

Closed
eunier opened this issue Feb 16, 2020 · 10 comments
Labels

Comments

@eunier
Copy link

eunier commented Feb 16, 2020

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
@ionitron-bot ionitron-bot bot added the triage label Feb 16, 2020
@Mrazator
Copy link

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

More info here:
facebook/create-react-app#8490

@liamdebeasi
Copy link
Contributor

liamdebeasi commented Feb 17, 2020

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 ionic-team/starters#1137 merged.

@eunier
Copy link
Author

eunier commented Feb 17, 2020

Thanks! working now.

@Elismar13
Copy link

Thanks. My project is running again.

@alex-shul
Copy link

alex-shul commented Mar 18, 2020

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

@MaximeMaillet
Copy link

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 react-dev-utils@10.0.0

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

Hives added a commit to Hives/radio-app that referenced this issue Mar 21, 2020
belthesar added a commit to belthesar/synthavln that referenced this issue Mar 23, 2020
react-scripts 3.3.0 does not work well on latest node 12 (installed via snap). Revving (with guidance from ionic-team/ionic-framework#20503) caused the package to run appropriately.
ulfaslak added a commit to ulfaslak/flowmap.gl-example that referenced this issue Mar 30, 2020
I get an error when I try to run the example. Same as reported in [this issue](ionic-team/ionic-framework#20503). Changing react-scripts to version 3.4.0, solved the problem.
@thehaystacker
Copy link

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

@jiapei100
Copy link

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

npm remove react-dev-utils && npm i react-dev-utils@10.0.0

@hillarykings
Copy link

Downgrade react-dev utils solve the problem.

npm remove react-dev-utils && npm i react-dev-utils@10.0.0

@ionitron-bot
Copy link

ionitron-bot bot commented Jun 4, 2020

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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Jun 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

9 participants