-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incompatible platform error for optional dependency with resolution entry #6834
Comments
This sounds familiar... I think there is an open issue for this, but I can't seem to find it. IIRC yarn adds the resolution as a hard-coded normal dependency first before checking the rest of the deps. Then it finds the optional dep and replaces it with the existing (non-optional) resolution dep. |
Is there any update on this? I can help with the PR, what would be the proper solution to this? |
I think this is fixed with #7273, right? /cc @kaylie-alexa |
Are you thinking of #2437? |
@BYK I can confirm this is still not fixed using yarn |
This is happening for me in yarn v1.19.1 |
Also seeing this on yarn v1.19.2 #7273 Seems to only have fixed the issue for direct optional dependencies The problem occurs when transitive dependencies are optional, so this test fails This is likely the most common usage of Workaround is to explicitly define the transitive optional dependency at the root, e.g: {
"resolutions": {
"**/fsevents": ">=1.2.4"
},
"optionalDependencies": {
"fsevents": "*"
}
} Then |
yarn issue with optional dependencies (mac yes, linux no) yarnpkg/yarn#6834 related to enforced fsevents version
I'm having a nightmare of a time with fsevents One fix is to force upgrade it, but then optional dependencies don't work right, Forcing it to be optional works but it doesn't work OOTB, needs this flag, ref: yarnpkg/yarn#6834 yarnpkg/yarn#6834 (comment)
I'm having a nightmare of a time with fsevents One fix is to force upgrade it, but then optional dependencies don't work right, Forcing it to be optional works but it doesn't work OOTB, needs this flag, ref: yarnpkg/yarn#6834 yarnpkg/yarn#6834 (comment)
Hi, do we have a solution for this? We are running the same issue for node 12 and fsevents 1.2.9. Works on mac os but incompatible with linux environments. |
I can confirm this bug on node 12.16.1, yarn 1.22.4 with fsevents 1.2.9+ |
For anyone experiencing this issue I have made a script we have been using for months with success. It runs on our CI prior to running yarn install.
It may need some tweaks for your specific use case but it has helped us get around the fsevents error on our CI (it isn't an issue locally as we all use Macs) It will remove the fsevents entry in your package json and yarn lock file. |
Fsevents is used in webpack. Updating it to the version that uses non-vulnerable fsevents can require some effort. To quickly address the issue, used yarn resolutions to resolve fsevents to non-vulnerable version. Yarn has [an issue](yarnpkg/yarn#6834) that resolutions make optional dependencies non-optional. Seeting fsevents as an optional dependency.
Fsevents is used in webpack. Updating it to the version that uses non-vulnerable fsevents can require some effort. To quickly address the issue, used yarn resolutions to resolve fsevents to non-vulnerable version. Yarn has [an issue](yarnpkg/yarn#6834) that resolutions make optional dependencies non-optional. Seeting fsevents as an optional dependency.
Fsevents is used in webpack. Updating it to the version that uses non-vulnerable fsevents can require some effort. To quickly address the issue, used yarn resolutions to resolve fsevents to non-vulnerable version. Could resolve to 1.2.11, resolving to ~2.3.2 only because visitor-app where where react-intl-tel-input already uses ~2.3.2, so this change won't add any new dependencies there. Yarn has [an issue](yarnpkg/yarn#6834) that resolutions make optional dependencies non-optional. Seeting fsevents as an optional dependency.
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
yarn
errors when a resolution for an optional dependency is specified if run on an incompatable platform.fsevents is only available on macOS (darwin):
Without the above resolutions
yarn
runs without error:What is the expected behavior?
No incompatibility errors.
Please mention your node.js, yarn and operating system version.
node v9.8.0, yarn 1.12.3, ubuntu 16.04.2 docker image
The text was updated successfully, but these errors were encountered: