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.

yarn pnp doesn't work with typescript

See original GitHub issue

Set up a pnp typescript project npx create-react-app pnp --use-pnp --typescript or npx create-react-app pnp --typescript --use-pnp order doesn’t matter

You then get

yarn add v1.12.1
[1/5] πŸ”  Resolving packages...
[2/5] 🚚  Fetching packages...
[3/5] πŸ”—  Linking dependencies...
[5/5] πŸ“ƒ  Building fresh packages...
success Saved lockfile.
success Saved 8 new dependencies.
info Direct dependencies
β”œβ”€ @types/jest@23.3.9
β”œβ”€ @types/node@10.12.1
β”œβ”€ @types/react-dom@16.0.9
β”œβ”€ @types/react@16.4.18
β”œβ”€ react-dom@16.6.0
β”œβ”€ react-scripts@2.1.0
β”œβ”€ react@16.6.0
└─ typescript@3.1.4
info All dependencies
β”œβ”€ @types/jest@23.3.9
β”œβ”€ @types/node@10.12.1
β”œβ”€ @types/react-dom@16.0.9
β”œβ”€ @types/react@16.4.18
β”œβ”€ react-dom@16.6.0
β”œβ”€ react-scripts@2.1.0
β”œβ”€ react@16.6.0
└─ typescript@3.1.4
✨  Done in 14.72s.
We detected TypeScript in your project (src/App.test.tsx) and created a tsconfig.json file for you.

It looks like you're trying to use TypeScript but do not have typescript installed.
Please install typescript by running yarn add typescript.
If you are not trying to use TypeScript, please remove the tsconfig.json file from your package root (and any TypeScript files).


Aborting installation.
  node --require /Users/bond/Projects/pnp-test/.pnp.js has failed.

Deleting generated file... package.json
Deleting generated file... yarn.lock
Done.

Environment


  System:
    OS: macOS 10.14
    CPU: x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
  Binaries:
    Node: 8.12.0 - /usr/local/bin/node
    Yarn: 1.12.1 - /usr/local/bin/yarn
    npm: 6.4.1 - /usr/local/bin/npm
  npmGlobalPackages:
    create-react-app: Not Found

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:40
  • Comments:17 (5 by maintainers)

github_iconTop GitHub Comments

16reactions
arcaniscommented, Apr 18, 2019

I found the time and pushed a PR: https://github.com/Realytics/fork-ts-checker-webpack-plugin/pull/250

Once merged I’ll make another one to create-react-app to upgrade fork-ts-checker-webpack-plugin and add support for the resolvers πŸ™‚

9reactions
arcaniscommented, Apr 20, 2019

PR up at #6856

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript 4.5 + yarn pnp issues #46874 - GitHub
If I change nodeLinker to node-modules (instead of pnp ), typescript@4.5 works fine. Likewise, downgrading to typescript@4.4 will also work withΒ ...
Read more >
Is it possible to use yarn-pnp with typescript/vscode?
Yes! Typescript cli works out of the box in Yarn 2+, so you can just add the package: yarn add -D typescript. and...
Read more >
TypeScript and Prettier with Yarn PnP not working in 2021.1
It shows the TypeScript and Prettier packages correctly in the settings dialogs and also resolves other packages in packages.json correctly when using PnP...
Read more >
Getting Started - Yarn
Getting started with Plug'n'Play isn't difficult - at its basis it just involves enabling one tiny settings in your package.json file: installConfig.pnp ....
Read more >
Yarn v2 PnP is simply a lifesaver if you have a medium+ sized ...
I'll say it's definitely not a plug-n-play migration (pardon the pun). Some issues we ran into: - it can be difficult to reason...
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