Skip to content

Certain TypeScript definitions are not recognised by react-scripts in Yarn PnP mode #10901

Description

@gausie

Describe the bug

Certain TypeScript definitions are just not recognised in processes spawned by react-scripts, while the rest work fine. VSCode thinks the definitions are present (and I can drill down into them using intellisense) and yarn run tsc compiles fine, so I do think this is somehow introduced by react-scripts, probably by Webpack.

The ones I've noticed are:

  • @types/loadable__components
  • @types/styled-system__theme-get
  • @redux-saga/types

Steps to reproduce

  1. Make a CRA typescript project
  2. Convert to Yarn PnP
  3. Install @loadable/component and @types/loadable__component
  4. Try to import @loadable/component

Expected behavior

It builds or runs successfully

Actual behavior

TypeScript thinks that no types exist for @loadable/component

Reproducible demo

See: https://github.com/gausie/reproduce-cra-pnp-ts-bug

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions