Description
Self-service
- I'd be willing to implement a fix
Describe the bug
I created a fork on github and wanted to use it instead of the original npm package. On running yarn install with yarn2 the following error message occurs:
➤ YN0013: │ vite-ssg@https://github.com/cimchd/vite-ssg.git#commit=ed70ed342c7430f660447c0e3b82a41eec18ad1e can't be found in the cache and will be fetched from GitHub
➤ YN0013: │ vite-ssg@https://github.com/cimchd/vite-ssg.git#commit=ed70ed342c7430f660447c0e3b82a41eec18ad1e can't be found in the cache and will be fetched from the remote repositor
➤ YN0001: │ Error: vite-ssg@https://github.com/cimchd/vite-ssg.git#commit=ed70ed342c7430f660447c0e3b82a41eec18ad1e: Assertion failed: Unsupported workflow
at /myProject/.yarn/releases/yarn-2.4.2.cjs:2:430959
at async a.mktempPromise (/myProject/.yarn/releases/yarn-2.4.2.cjs:2:520558)
at async /myProject/.yarn/releases/yarn-2.4.2.cjs:2:429255
at async a.mktempPromise (/myProject/.yarn/releases/yarn-2.4.2.cjs:2:520558)
at async /myProject/.yarn/releases/yarn-2.4.2.cjs:2:428681
To check if I did something wrong I created a minimal empty folder and did the following with yarn1:
$ mkdir testproject1 && cd testproject1
$ yarn init
$ yarn add vite-ssg@cimchd/vite-ssg
The result was a successfull install of the package.
I did some further investigations and found out, that when I tried the same with yarn2 and added a yarn.lock to the repo and it worked. For my purpose this is ok, but I think this is not the intended behaviour or the error message is not specific enough.
To reproduce
Repo without yarn.lock (Doesn't work):
$ mkdir testproject2 && cd testproject2
$ yarn set version berry
$ yarn init
$ yarn add vite-ssg@cimchd/vite-ssg#commit=ed70ed342c7430f660447c0e3b82a41eec18ad1e
or as one-liner:
$ mkdir testproject2 && cd testproject2 && yarn set version berry && yarn init && yarn add vite-ssg@cimchd/vite-ssg#commit=ed70ed342c7430f660447c0e3b82a41eec18ad1e
Same repo, but with a yarn.lock included (works):
$ mkdir testproject2 && cd testproject2
$ yarn set version berry
$ yarn init
$ yarn add vite-ssg@cimchd/vite-ssg#commit=16bf2083c778e6096299c11cf27234788572ee2b
or as one-liner:
$ mkdir testproject2 && cd testproject2 && yarn set version berry && yarn init && yarn add vite-ssg@cimchd/vite-ssg#commit=16bf2083c778e6096299c11cf27234788572ee2b
Environment
System:
OS: Linux 4.19 Ubuntu 20.04 LTS (Focal Fossa)
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Binaries:
Node: 14.17.0 - /tmp/xfs-ccaeeffc/node
Yarn: 2.4.2 - /tmp/xfs-ccaeeffc/yarn
npm: 6.14.13 - /usr/local/bin/npm
Additional context
I tried the same with a lodash fork. It worked well although lodash has also no yarn.lock file (but a npm package-lock.json).
The vite-ssg package seems to be created with pnpm. Maybe this is the reason why it behaves different.
Activity
yarnbot commentedon Aug 23, 2021
Hi! 👋
This issue looks stale, and doesn't feature the
reproducible
label - which implies that you didn't provide a working reproduction using Sherlock. As a result, it'll be closed in a few days unless a maintainer explicitly vouches for it or you edit your first post to include a formal reproduction (you can use the playground for that).Note that we require Sherlock reproductions for long-lived issues (rather than standalone git repositories or similar) because we're a small team. Sherlock gives us the ability to check which bugs are still affecting the master branch at any given point, and decreases the amount of code we need to run on our own machines (thus leading to faster bug resolutions). It helps us help you! 😃
If you absolutely cannot reproduce a bug on Sherlock (for example because it's a Windows-only issue), a maintainer will have to manually add the
upholded
label. Thanks for helping us triaging our repository! 🌟merceyz commentedon Aug 23, 2021
We haven't added support for pnpm yet
[-][Bug?]: Assertion failed: Unsupported workflow on github repo as dependency in package.json (missing yarn.lock in repo)[/-][+][Bug]: Can't install package from git repo using pnpm[/+]seivan commentedon Jul 7, 2022
Any updates on this?
What's the work around, could I clone it locally, and refer to it?
laptou commentedon Jul 14, 2022
@seivan
Did you figure out if there is a workaround? I saw in #3618 that this is scheduled to be fixed in the next canary release, but I'd like to be able to keep moving forward in the meantime.
flying-sheep commentedon Nov 23, 2022
Did that canary release happen already or is the PR still on track.
If this isn’t merged very soon: Can we implement a workaround and fall back to yarn instead of crashing with a failed assertion? Just seeing “Assertion failed: Unsupported workflow“ without any context is really bad UX.
5 remaining items
Philzen commentedon May 15, 2024
Is there any workaround for this? Quite a bump otherwise...
yarn install
throws on dependencies that usepnpm
bcnmy/nexus#106RamDurgaSai commentedon Oct 4, 2024
Still getting the error
Any updated on this issue ? may be
arunbluez commentedon Nov 22, 2024
One of my colleagues was getting this error and i was not, so upon investigation, i had the 1.22 version which doesnt seem to throw any errors, this error shows up only after migrating to yarn/berry. Maybe this helps someone. Have a good day 🙏
👋 goodbye yarn, forever. yarnpkg/berry#3169
Philzen commentedon Jan 9, 2025
Daniel15 commentedon Jan 9, 2025
vlascik commentedon Jan 9, 2025
@Daniel15 I can confirm it's still an issue and a one that will force us to abandon yarn if not fixed as well - if we need to use a github fork of a library that uses pnpm internally (and now we do),
yarn install
breaks.Everyone in this situation, and it will only happen more and more often as libraries use pnpm more, will be forced to do the same - a package manager that can't complete an install is pretty useless.
Philzen commentedon Jan 9, 2025
@Daniel15 the use case is referencing repositories directly in
package.json
dependencies.For example, this works:
as that repo is yarn-based.
But this one fails with the dreaded
Unsupported workflow
error:This is actually a very common use case, i.e. when there are urgently needed fixes or features already available in the repository that i want to use in my project, but the maintainers haven't shipped them to NPM yet.
There are workarounds though:
However, it would be awesome if those extra steps wouldn't be necessary for non-yarn repositories.
justinfagnani commentedon Jan 9, 2025
@Philzen You really didn't need to spam a bunch of random people here.
arcanis commentedon Jan 9, 2025
I'm going to lock this issue considering the notification issue. There's a PR opened, and it's still in draft mode, so it doesn't get merged. If someone wants to help the project they're welcome to rebase #3618 and bring it to finish line.