create-react-app: TypeError [ERR_INVALID_ARG_TYPE]
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
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 59
- Comments: 27 (1 by maintainers)
Commits related to this issue
- build(yarn): https://github.com/facebook/create-react-app/issues/8499#issuecomment-586998990 — committed to crowake13/react-test by qvranesic 4 years ago
- build(yarn): https://github.com/facebook/create-react-app/issues/8499#issuecomment-586998990 — committed to crowake13/react-test by qvranesic 4 years ago
- Pin dependency due to bug See: https://github.com/facebook/create-react-app/issues/8499 — committed to isle-project/isle-dashboard by Planeshifter 4 years ago
- feat(react-scripts): allow PUBLIC_URL in develoment mode (#7259) Co-authored-by: Eric Clemmons <eric@smarterspam.com> Co-authored-by: Alex Guerra <alex@heyimalex.com> Co-authored-by: Kelly <kelly.m... — committed to facebook/create-react-app by iamandrewluca 4 years ago
- Upgrade react-scripts to ^3.4.0 to fix https://github.com/facebook/create-react-app/issues/8499 — committed to jctiru/lnshop-frontend by jctiru 4 years ago
- Apply this - https://github.com/facebook/create-react-app/issues/8499#issuecomment-589561657 — committed to cosmostation/mintscan-binance-dex-frontend by fl-y 4 years ago
- fix: react-scripts to 3.4 to fix path error see: https://github.com/facebook/create-react-app/issues/8499 — committed to J-Currier/jupiter by larryjl 4 years ago
- Update react-script to ^3.4.0 As per this thread: https://github.com/facebook/create-react-app/issues/8499, upgrading to 3.4.0 and rebuilding node_modules helped fix the error. — committed to seanprashad/leetcode-patterns by deleted user 4 years ago
- Solves dependency issue that prevented app startup. https://github.com/facebook/create-react-app/issues/8499 — committed to HKN-UCSD/old-hkn-server by godwinpang 4 years ago
- Solves dependency issue that prevented app startup. https://github.com/facebook/create-react-app/issues/8499 — committed to HKN-UCSD/old-hkn-server by godwinpang 4 years ago
- Solves dependency issue that prevented app startup. https://github.com/facebook/create-react-app/issues/8499 — committed to HKN-UCSD/old-hkn-server by godwinpang 4 years ago
- Solves dependency issue that prevented app startup. https://github.com/facebook/create-react-app/issues/8499 — committed to HKN-UCSD/old-hkn-server by godwinpang 4 years ago
- Update react-scripts to 3.4.x See facebook/create-react-app#8499 — committed to UWmathNEWS/slugline-web by tyxchen 4 years ago
- update react-scripts to 3.4.0 to fix https://github.com/facebook/create-react-app/issues/8499 add react-datetimepicker for datetime chooser in forms — committed to dmlond/mlaas-ui by dmlond 4 years ago
- Pin dependency due to bug See: https://github.com/facebook/create-react-app/issues/8499 — committed to isle-project/isle-dashboard by Planeshifter 4 years ago
- Monorepo frontend migration (#175) * Adds dx-react-scheduler dependencies for calendar. * Adds route for CalendarPage with sidebar link. Temporarily routes to ResumePage. * Solves dependency is... — committed to HKN-UCSD/hkn-server by thai-truong 3 years ago
- Solves dependency issue that prevented app startup. https://github.com/facebook/create-react-app/issues/8499 — committed to HKN-UCSD/hkn-server by godwinpang 4 years ago
- Solves dependency issue that prevented app startup. https://github.com/facebook/create-react-app/issues/8499 — committed to HKN-UCSD/hkn-server by godwinpang 4 years ago
- Solves dependency issue that prevented app startup. https://github.com/facebook/create-react-app/issues/8499 — committed to HKN-UCSD/hkn-server by godwinpang 4 years ago
- Solves dependency issue that prevented app startup. https://github.com/facebook/create-react-app/issues/8499 — committed to HKN-UCSD/hkn-server by godwinpang 4 years ago
I soved that upgrading
"react-scripts"
from"3.3.0"
to"^3.4.0"
I have exact same issue after re-installing my dependencies.
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 notejected
yet.Edit Fixed the issue for me: https://stackoverflow.com/a/60242323/3532661
Here is the breaking change: https://github.com/facebook/create-react-app/commit/1cbc6f7db62f78747cb6ca41450099181139325e#diff-595228c9c4e2f6619c6bb1478ba4ef87R14
Made a workaround to it by modifying
webpackDevServer.config.js
to following (we don’t use PUBLIC_URL):I had the very same issue. By adding
in my
package.json
file, I was able to avoid this issue. Maybe something wrong with"react-dev-utils": "10.2.0"
? For that reason I cannot upgrade toreact-scripts 3.4.0
Can confirm. Exact stacktrace for me:
Right, but this question pertains specifically to ejected apps.
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.
For ejected apps (with multiple entry points), the problem is caused by
ManifestPlugin
(webpack.config.js
) ingenerate
option. It wrongly assumes that the entry point in named asmain
You need to replace it with this
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)
This worked for me. Thanks.
I’m done with this
npm remove react-dev-utils && npm i react-dev-utils@10.0.0
yarn add react-scripts@3.4.0
the problem is with react scripts, updating it to the latest version solves the issues.I updated react-scripts to 3.4.0 and that fixed the issue
Related? https://github.com/facebook/create-react-app/pull/7259 Solution: https://stackoverflow.com/questions/60234640/typeerror-err-invalid-arg-type-the-path-argument-must-be-of-type-string-re
I’ve solved using the version
3.4.1
ofreact-scripts
.This worked for me!
Cheers!
or bump
react-scripts
to 3.4.1Same issue here in v3.3.0, downgrading to v3.2.0 or upgrading to v3.4.0 solves the problem, but with v3.4.0 the routing URL with
homepage
config seems to behave differently from v3.2.0:With
hompage:"/my/dir"
set in mypackage.json
and using React router component<Link to="/about">About</Link>
to do the routing, different version will have different behavior on the url generated in<a href="xxx">
:v3.2.0
-><a href="/about">
v3.4.0
-><a href="/my/dir/about">
But it seems to be only affecting dev version of the application, production build is always pointing to
<a href="/my/dir/about">
Any thoughts on this behavior?
Same issue here, resolved by reverting to 10.1.0
Seems that there was some incompatibility between eslint, prettier and CRA dependencies (I think of loaders).
After upgrading to 3.4.0 of cra, 1.19.1 of prettier, 3.1.2 of eslint-plugin-prettier, the error has gone.