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.

[Bug] compat/typescript patch does not apply on typescript@4.2.0-beta

See original GitHub issue
  • I’d be willing to implement a fix

Describe the bug

➤ YN0013: │ typescript@npm:4.2.0-beta can't be found in the cache and
➤ YN0013: │ typescript@patch:typescript@npm%3A4.2.0-beta#builtin<comp
➤ YN0013: │ typescript@npm:4.2.0-beta can't be found in the cache and
➤ YN0066: │ typescript@patch:typescript@npm%3A4.2.0-beta#builtin<compat/typescript>::version=4.2.0-beta&hash=cc6730: Cannot apply hunk #6
➤ YN0000: │           ConfigFileProgramReloadLevel[ConfigFileProgramReloadLevel["None"] = 0] = "None";
➤ YN0000: │           ConfigFileProgramReloadLevel[ConfigFileProgramReloadLevel["Partial"] = 1] = "Partial";
➤ YN0000: │           ConfigFileProgramReloadLevel[ConfigFileProgramReloadLevel["Full"] = 2] = "Full";
➤ YN0028: │ +         ConfigFileProgramReloadLevel[ConfigFileProgramReloadLevel["Resolutions"] = 3] = "Resolutions";
➤ YN0000: │       })(ConfigFileProgramReloadLevel = ts.ConfigFileProgramReloadLevel || (ts.ConfigFileProgramReloadLevel = {}));
➤ YN0000: │       function updateMissingFilePathsWatch(program, missingFileWatches, createMissingFileWatch) {
➤ YN0000: │           var missingFilePaths = program.getMissingFilePaths();

To Reproduce

yarn add typescript@4.2.0-beta (or yarn up); with enableInlineHunks: true in the .yarnrc.yml for the diff printout.

Bonus points: the Playground reproduction fails because the node version is too old.

Environment if relevant (please complete the following information):

  • OS: WSL
  • Node version: 14.15.4
  • Yarn version: 2.4.0

Additional context

The patch applies in older versions of typescript.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
Hideman85commented, May 13, 2022

From @niieani Sure, create .yarn/plugins/@yarnpkg/plugin-compat.cjs:

module.exports = {
  name: `@yarnpkg/plugin-compat`,
  factory: (require) => {
    // dummy implementation to override the built-in version of this plugin
    return {}
  },
}

Add to .yarnrc.yml:

plugins:
  - path: .yarn/plugins/@yarnpkg/plugin-compat.cjs
    spec: '@yarnpkg/plugin-compat'

You do not imagine how much you saved me time there. I hate the checksum issue I’m getting with these compat patches… And I dont even use PnP :face_exhaling: I read the PR and the Q&A but I have no break by disabling this. Also why not simply check nodeLinker === ‘pnp’ then patch… Well thanks again you saved me a bunch of time with this quick fix 🙂

3reactions
niieanicommented, Feb 3, 2021

Sure, create .yarn/plugins/@yarnpkg/plugin-compat.cjs:

module.exports = {
  name: `@yarnpkg/plugin-compat`,
  factory: (require) => {
    // dummy implementation to override the built-in version of this plugin
    return {}
  },
}

Add to .yarnrc.yml:

plugins:
  - path: .yarn/plugins/@yarnpkg/plugin-compat.cjs
    spec: '@yarnpkg/plugin-compat'
Read more comments on GitHub >

github_iconTop Results From Across the Web

git: patch does not apply
Doesn't work for me in the case where the issues are caused by whitespace differences. I never get a prompt, and --3way doesn't...
Read more >
git: patch does not apply
Hello! I have a certain patch called my_pcc_branch.patch. When I try to apply it, I get following message: $ git apply --check my_pcc_branch.patch...
Read more >
git-apply - Apply a patch to files and/or to the index
This command applies the patch but does not create a commit. ... If the file to be patched in the working tree is...
Read more >
5.3 Distributed Git - Maintaining a Project
git apply --check 0001-seeing-if-this-helps-the-gem.patch error: patch failed: ticgit.gemspec:1 error: ticgit.gemspec: patch does not apply.
Read more >
How to apply git diff and fix patch failed error - Fresh Beginning
Git diff is a powerful command which allows you to see you recently made changes whether they are staged or not.
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