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
- Make a CRA typescript project
- Convert to Yarn PnP
- Install
@loadable/component and @types/loadable__component
- 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
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) andyarn run tsccompiles fine, so I do think this is somehow introduced byreact-scripts, probably by Webpack.The ones I've noticed are:
@types/loadable__components@types/styled-system__theme-get@redux-saga/typesSteps to reproduce
@loadable/componentand@types/loadable__component@loadable/componentExpected behavior
It builds or runs successfully
Actual behavior
TypeScript thinks that no types exist for
@loadable/componentReproducible demo
See: https://github.com/gausie/reproduce-cra-pnp-ts-bug