question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Typescript and pnp enabled app fails to compile

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:7
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

7reactions
timinicommented, Jan 14, 2020

Im also having this issue trying to use CRA as a monorepo package (yarn workspaces) with yarn PNP

0reactions
iansucommented, May 19, 2021

Closing as this seems to be fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Yarn 3.x PNP typescript CRA eslint not working with VSCode
I ran into this issue a bit ago and found that this is due to the module resolver not pointing to the correct...
Read more >
Can't start TypeScript service in projects with Yarn pnp when ...
Can't start TypeScript service in projects with Yarn pnp when TypeScript is not in the root folder ; Project, WebStorm ; Type, Bug...
Read more >
How to build Power Apps Custom Controls using TypeScript
2. Initialize a Custom control. Just like any other developer project, you need to initialize the control-project and you will use the power ......
Read more >
A guide through The Wild Wild West of setting up a mono repo ...
json scripts that we used to specify build order. Referenced projects must have the composite setting enabled. This setting is needed to ensure...
Read more >
Questions & Answers | Yarn - Package Manager
Why is TypeScript patched even if I don't use Plug'n'Play? ... us to draft a first implementation of a ESM-compatible PnP loader, which...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found