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.

TypeError [ERR_INVALID_ARG_TYPE]

See original GitHub issue

Started getting TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined in multiple CRA projects after dependency updates today.

Updating react-scripts solved the issue in my unejected apps, but I still have no solution for ejected ones. I’ve tried updating react-dev-utils manually but am still seeing it on yarn start - anyone with ejected CRAs have this issue?


Edit: Downgrading react-dev-utils to 10.0.0 resolves the error for ejected apps in development mode only, but will not work in production or served over HTTPS due to https://github.com/facebook/create-react-app/issues/8075 which was not fixed until after 10.0.0.


Edit 2: @syberen said:

I solved it the hard way, by creating a new react app, ejecting, and copy-pasting the relevant changes in the config and scripts into my ejected project.

^^ works fine for ejected apps

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:59
  • Comments:27 (1 by maintainers)

github_iconTop GitHub Comments

110reactions
Douglasacostcommented, Feb 20, 2020

I have the same issue now. TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined at validateString (internal/validators.js:125:11) at Object.join (path.js:1147:7)

I soved that upgrading "react-scripts" from "3.3.0" to "^3.4.0"

96reactions
emmsdancommented, Feb 17, 2020

I have exact same issue after re-installing my dependencies.

    at validateString (internal/validators.js:112:11)
    at Object.join (path.js:1040:7)
    at noopServiceWorkerMiddleware (/edn/emmsdan/PaymentGateway/web/node_modules/react-dev-utils/noopServiceWorkerMiddleware.js:14:26)
    at Layer.handle [as handle_request] (/edn/emmsdan/PaymentGateway/web/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix 

I tried, deleting my node_modules and re-installing but no luck…

Please, how can I resolve this issue? I am using create-react-app and I have not ejected yet.


Edit Fixed the issue for me: https://stackoverflow.com/a/60242323/3532661

Read more comments on GitHub >

github_iconTop Results From Across the Web

The "path" argument must be of type string. Received ...
I'm working on a project in React and ran into a problem that has me stumped. Whenever I run yarn start I get...
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
In this tutorial, we are going to learn about how to fix the TypeError [ERR_INVALID_ARG_TYPE]: The “path” argument must be of type string....
Read more >
Why I got TypeError [ERR_INVALID_ARG_TYPE]: ...
When I try to upload my files to the server I get this error. ... TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of...
Read more >
The "path" argument must be of type string. Received ...
It says, that this error occurs when the react-scripts version is old. So, delete all your current node modules, install the latest react-scripts...
Read more >

github_iconTop Related Medium Post

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