Skip to content

Typescript and pnp enabled app fails to compile #7456

@mateja176

Description

@mateja176

Describe the bug

yarn start results in the following error

Failed to compile.

undefined
TypeScript error in undefined(undefined,undefined):
Cannot find type definition file for 'lodash'.  TS2688

Did you try recovering your dependencies?

Ran yarn, using yarn@latest ( atm yarn@1.17.3 )

Which terms did you search for in User Guide?

  • typescript
  • yarn pnp
  • typescript and yarn pnp
  • lodash

Environment

Environment Info:

  System:
    OS: Linux 5.0 Ubuntu 19.04 (Disco Dingo)
    CPU: (8) x64 AMD Ryzen 7 2700U with Radeon Vega Mobile Gfx
  Binaries:
    Node: 11.14.0 - ~/.nvm/versions/node/v11.14.0/bin/node
    Yarn: 1.17.3 - ~/.nvm/versions/node/v11.14.0/bin/yarn
    npm: 6.10.2 - ~/.nvm/versions/node/v11.14.0/bin/npm
  Browsers:
    Chrome: 75.0.3770.142
    Firefox: 68.0.1
  npmPackages:
    react: Not Found
    react-dom: Not Found
    react-scripts: Not Found
  npmGlobalPackages:
    create-react-app: 3.0.1

Steps to reproduce

(Write your steps here:)

  1. create-react-app test --typescript --use-pnp
  2. cd test
  3. yarn
  4. yarn start

Expected behavior

No error occurs and app start sucessfully

Actual behavior

yarn-pnp-terminal

yarn-pnp-browser

Reproducible demo

https://github.com/mateja176/yarn-pnp-demo

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions