Skip to content

[Bug] Module Not Found on Create-React-App #958

Closed
facebook/create-react-app
#8509
@frencojobs

Description

@frencojobs
  • I'd be willing to implement a fix

Describe the bug

I was working on a create-react-app project, and I had to install a package and so I did. It was working as expected, but when I tried to use the package I installed in my code, this error appeared.

./src/App.js
Module not found: Something that got detected as your top-level application (because it doesn't seem to belong to any package) tried to access a package that is not declared in your dependencies

To fix this, I had to restart the building process, which is bad when I am expecting for a hot-reload.

To Reproduce

yarn dlx create-react-app cra
cd cra
yarn start
# without interrupting the process, on another tab
yarn add random
yarn install
# try to consume the random package

Environment if relevant (please complete the following information):

  • OS: Linux
  • Node version 12.14.0
  • Yarn version 2.0.0-rc.27

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions