question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:14
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

374reactions
Mrazatorcommented, Feb 16, 2020

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

7reactions
alex-shulcommented, Mar 18, 2020

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

The "path" argument must be of type string ... - Stack Overflow
I'm working on a project in React and ran into a problem that has me stumped. Whenever I ...
Read more >
[Fix] TypeError [ERR_INVALID_ARG_TYPE]: The “path ...
Have you run into the error “TypeError [ERR_INVALID_ARG_TYPE]: The “path” argument must be of type string. Received undefined”? In this story I'll go...
Read more >
The "path" argument must be of type string. Received ... - GitHub
The following error is thrown: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined at new ...
Read more >
typeerror [err_invalid_arg_type]: the "path" argument must be ...
I thought the error was telling me that path was undefined. ... [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an...
Read more >
The path argument must be of type string - Reactgo
Received type undefined raised when starting the react app. When we run an npm start or yarn start command in our project, the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found