Skip to content

[Bug] fsevents Cannot apply hunk #1 #931

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
1 task
doums opened this issue Feb 11, 2020 · 8 comments
Closed
1 task

[Bug] fsevents Cannot apply hunk #1 #931

doums opened this issue Feb 11, 2020 · 8 comments
Labels
bug Something isn't working

Comments

@doums
Copy link

doums commented Feb 11, 2020

  • I'd be willing to implement a fix

Describe the bug
In my company's mono repo I tried to migrate to Yarn 2. I ran yarn set version berry then yarn install, this is its output:

➤ YN0000: └ Completed in 18.14s
➤ YN0000: ┌ Fetch step
➤ YN0013: │ fsevents@patch:fsevents@npm%3A2.0.7#builtin<compat/fsevents>::version=2.0.7&hash=e8cd9e can't be found in the cache and will be fetched from the disk
➤ YN0001: │ Error: fsevents@patch:fsevents@npm%3A2.0.7#builtin<compat/fsevents>::version=2.0.7&hash=e8cd9e: Cannot apply hunk #1
    at c (/home/pierre/Documents/owp/aw-front/.yarn/releases/yarn-berry.js:58:888997)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async /home/pierre/Documents/owp/aw-front/.yarn/releases/yarn-berry.js:58:891128
    at async o (/home/pierre/Documents/owp/aw-front/.yarn/releases/yarn-berry.js:58:888280)
    at async Object.t.applyPatchFile (/home/pierre/Documents/owp/aw-front/.yarn/releases/yarn-berry.js:58:891101)
    at async t.PatchFetcher.patchPackage (/home/pierre/Documents/owp/aw-front/.yarn/releases/yarn-berry.js:58:888035)
    at async /home/pierre/Documents/owp/aw-front/.yarn/releases/yarn-berry.js:58:887292
    at async /home/pierre/Documents/owp/aw-front/.yarn/releases/yarn-berry.js:36:570234
    at async /home/pierre/Documents/owp/aw-front/.yarn/releases/yarn-berry.js:36:570177
➤ YN0000: └ Completed in 1.36s
➤ YN0000: Failed with errors in 19.5s

To Reproduce

Sorry but I don't share any code/package.json because it's private. But I could try to adapt an share dummy stuff.
What I can tell is we are using a mono repo architecture, using yarn workspaces feature to manage it.
The root package.json looks something like this:

{
  "name": "project x",
  "private": true,
  "scripts": {
    "clean": "./clean_node.sh",
    "build_libs": "./build_libs.sh"
  },
  "workspaces": {
    "packages": [
      "workspaces/*"
    ],
    "nohoist": [
      "**/webpack",
      "**/jest"
    ]
  },
  "dependencies": {},
  "devDependencies": {
    "eslint": "^6.6.0",
    ...
    "jest": "^24.9.0",
    "prettier": "^1.19.1"
  }
}

Under the directory workspaces are our workspaces.
We have no direct dependencies on fsevents.

Screenshots

image

Environment if relevant (please complete the following information):

  • OS: Arch Linux
  • Node version: 12.12.0
  • Yarn version: 2.0.0-rc.28
@doums doums added the bug Something isn't working label Feb 11, 2020
@arcanis
Copy link
Member

arcanis commented Feb 11, 2020

Hey @doums ! Thanks for taking the time to open an issue, but I'll close it as it's a duplicate of #911 and #719 🙂

The fix is already in master, you can use it by running yarn set version from sources. It'll also be officially published later today.

@arcanis arcanis closed this as completed Feb 11, 2020
@doums
Copy link
Author

doums commented Feb 11, 2020

Ok cool, thank you !

@yorch
Copy link

yorch commented Jun 27, 2020

Hey @arcanis

I've just starting trying to migrate a project to yarn v2, but seeing this error using berry, latest and master, please see my comment here.

Many thanks!

@SimonBackx
Copy link

Hi! I had to use yarn set version from sources to fix this issue, but this issue is more than a year old? Is there a specific reason why this fix isn't published yet?

Sadly it was a bit of a mess to upgrade to yarn berry, even when the docs said it should be easy without the PnP.

@merceyz
Copy link
Member

merceyz commented May 29, 2021

This issue was fixed in 2.0.0-rc.29 which was released on 11.02.2020

@SimonBackx
Copy link

This issue was fixed in 2.0.0-rc.29 which was released on 11.02.2020

Thank you for your reply. However, I kept having the issue on the latest version of berry. If I installed from sources, the issue went away.

@merceyz
Copy link
Member

merceyz commented May 30, 2021

Are you sure that was for fsevents? If it was for typescript that was fixed by #2889 which hasn't been released yet

@SimonBackx
Copy link

Hmmm... I also got it for TypeScript I think. I'm not sure if I got it for fsevents too.

I've switched back to Yarn v1 because I still had some other issues with workspaces (hoisting stopped working in scripts, and I didn't liked the solution https://yarnpkg.com/getting-started/qa#how-to-share-scripts-between-workspaces), which was not described in the migration guide. Somehow these issues made me doubt the stability of Yarn v2. Maybe I'll try again later. Thank you anyway!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants