Skip to content

List prop-types under optionalDependencies #322

Description

@Eli-Black-Work

react-async uses prop-types if it's available, but it doesn't list it as an optional dependency in its package.json

This means that users see a warning when using Yarn's PnP (Plug and Play) feature:

WARNING in ../.yarn/$$virtual/react-async-virtual-3d2eb0f2b6/0/cache/react-async-npm-10.0.1-4e014b49b8-dd7e80d975.zip/node_modules/react-async/dist-web/index.js 35:14-35
Module not found: Error: Can't resolve 'prop-types' in 'C:\my-project\.yarn\$$virtual\react-async-virtual-3d2eb0f2b6\0\cache\react-async-npm-10.0.1-4e014b49b8-dd7e80d975.zip\node_modules\react-async\dist-web'
 @ ../.yarn/$$virtual/@my-project-virtual-d9fa77a61d/5/my-project/my-file.js 2:0-39 32:20-28

I think that the fix should be for react-async to add prop-types as an optional dependency in its package.json file, like so:

"optionalDependencies": {
   "prop-types": "*"
}

This was previously reported at #115, but that issue is closed, so I'm opening a new one 🙂

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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