Create-react-app: [Solved] TypeError — yarn start stopped working

Created on 15 Feb 2020  Â·  9Comments  Â·  Source: facebook/create-react-app

I’m posting this to try to help anyone who may find themselves stuck.

I am on macOS 10.14.6 / Yarn 1.22.

I started experiencing an error today — I don’t know why it started happening, all I know is several attempts to clean-wipe Node/NPM/Yarn/clone from GitHub, etc. nothing worked. I kept getting this stack trace whenever I tried to run yarn start:

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 (/Users/zaydek/github/codex-app/node_modules/react-dev-utils/noopServiceWorkerMiddleware.js:14:26)
    at Layer.handle [as handle_request] (/Users/zaydek/github/codex-app/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/Users/zaydek/github/codex-app/node_modules/express/lib/router/index.js:317:13)
    at /Users/zaydek/github/codex-app/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/Users/zaydek/github/codex-app/node_modules/express/lib/router/index.js:335:12)
    at next (/Users/zaydek/github/codex-app/node_modules/express/lib/router/index.js:275:10)
    at launchEditorMiddleware (/Users/zaydek/github/codex-app/node_modules/react-dev-utils/errorOverlayMiddleware.js:20:7)
    at Layer.handle [as handle_request] (/Users/zaydek/github/codex-app/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/Users/zaydek/github/codex-app/node_modules/express/lib/router/index.js:317:13)
    at /Users/zaydek/github/codex-app/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/Users/zaydek/github/codex-app/node_modules/express/lib/router/index.js:335:12)
    at next (/Users/zaydek/github/codex-app/node_modules/express/lib/router/index.js:275:10)
    at handleWebpackInternalMiddleware (/Users/zaydek/github/codex-app/node_modules/react-dev-utils/evalSourceMapMiddleware.js:42:7)
    at Layer.handle [as handle_request] (/Users/zaydek/github/codex-app/node_modules/express/lib/router/layer.js:95:5)

What ended up fixing it (at least for now) is updating to the latest CRA version e.g. yarn add --exact [email protected].

Something react scripts was calling was breaking. Anyway, this is fixed — I hope this helps someone.

bug report needs triage stale

Most helpful comment

I also have this issue:
Screenshot_2020-02-16 Error

All 9 comments

Interestingly this happened again once I ran yarn serve --single ... on a build of my site, then went back to yarn start. Same error. Fortunately I was able to quickly fix it this time adding the latest react-scripts again. 😅

I also have this issue:
Screenshot_2020-02-16 Error

Were you able to fix it? I tried a couple of things — only yarn add --exact [email protected] repeatedly worked for me.

Has anyone an idea which changes in [email protected] resolved the issue?
I've got the same error, but don't have a react app, but a nestjs app.

Try running yarn cache list to print out your cached packages, then you can compare with the version in your package.json to make sure they match. If you still get errors, run yarn cache clean to clear your entire cache and run yarn install to repopulate them.

i got the same issues
but when i upgrade react-script to 3.4.0 and fixed this .

but i dont know why .

I’m posting this to try to help anyone who may find themselves stuck.

@codex-zaydek Thank you for being so thoughtful. You certainly helped me, and I'm glad to say that it's something I try to remember to do when I find an answer no one else seems to have done.

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

barcher picture barcher  Â·  3Comments

adrice727 picture adrice727  Â·  3Comments

Evan-GK picture Evan-GK  Â·  3Comments

dualcnhq picture dualcnhq  Â·  3Comments

JimmyLv picture JimmyLv  Â·  3Comments