Skip to content

Cannot find module 'react-dev-utils/workspaceUtils' #5437

Closed
@bvaughn

Description

@bvaughn

This error was recently reported on one of my GitHub repos and a quick Google search has shown it mentioned in a couple of others:

Error: Cannot find module 'react-dev-utils/workspaceUtils'

It looks like the error is caused by the following line in the ejected config/paths.js for some older versions of create-react-app:

const findMonorepo = require('react-dev-utils/workspaceUtils').findMonorepo;

The line in question is no longer there. (It was added in 2c34d5b and removed in cc328d6.) So I'm guessing this issue is only affect apps that installed a pre-release of 2.0 and ejected in between those commits.

If you're not using the monorepo feature– I believe a quick fix for those experiencing this issue would be to just manually edit that ejected config file to remove the line in question. If you are using it, I think the appropriate fix would be to manually replace the contents of config/paths.js with the latest revision. (No new dependencies are introduced so I think this should be safe to do.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions