Skip to content
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

Peer Dependency @sanity/ui breaking deploys #20

Open
nwazuo opened this issue Apr 7, 2022 · 5 comments
Open

Peer Dependency @sanity/ui breaking deploys #20

nwazuo opened this issue Apr 7, 2022 · 5 comments

Comments

@nwazuo
Copy link
Contributor

nwazuo commented Apr 7, 2022

Hi. I just started using this plugin and my Netlifty deploys fail because of the conflicting peer dependency @sanity/ui v. 0.36.17

7:52:53 PM: npm ERR! Found: @sanity/[email protected]
7:52:53 PM: npm ERR! node_modules/@sanity/ui
7:52:53 PM: npm ERR!   @sanity/ui@"^0.37.2" from @sanity/[email protected]
7:52:53 PM: npm ERR!   node_modules/@sanity/base
7:52:53 PM: npm ERR!     @sanity/base@"^2.27.2" from the root project
7:52:53 PM: Failed during stage 'building site': Build script returned non-zero exit code: 1 (https://ntl.fyi/exit-code-1)
7:52:53 PM: npm ERR!     peer @sanity/base@"^2.0.0" from @sanity/[email protected]
7:52:53 PM: npm ERR!     node_modules/@sanity/dashboard
7:52:53 PM: npm ERR!       @sanity/dashboard@"^2.29.2" from the root project
7:52:53 PM: npm ERR!     6 more (@sanity/default-layout, @sanity/desk-tool, ...)
7:52:53 PM: npm ERR!   @sanity/ui@"^0.37.2" from @sanity/[email protected]
7:52:53 PM: npm ERR!   node_modules/@sanity/dashboard
7:52:53 PM: npm ERR!     @sanity/dashboard@"^2.29.2" from the root project
7:52:53 PM: npm ERR!   6 more (@sanity/default-layout, @sanity/default-login, ...)
7:52:53 PM: npm ERR!
7:52:53 PM: npm ERR! Could not resolve dependency:
7:52:53 PM: npm ERR! sanity-plugin-dashboard-widget-netlify@"^1.2.1" from the root project
7:52:53 PM: npm ERR!
7:52:53 PM: npm ERR! Conflicting peer dependency: @sanity/[email protected]
7:52:53 PM: npm ERR! node_modules/@sanity/ui
7:52:53 PM: npm ERR!   peer @sanity/ui@"^0.36.12" from [email protected]
7:52:53 PM: npm ERR!   node_modules/sanity-plugin-dashboard-widget-netlify
7:52:53 PM: npm ERR!     sanity-plugin-dashboard-widget-netlify@"^1.2.1" from the root project
7:52:53 PM: npm ERR!
7:52:53 PM: npm ERR! Fix the upstream dependency conflict, or retry
7:52:53 PM: npm ERR! this command with --force, or --legacy-peer-deps
7:52:53 PM: npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
7:52:53 PM: npm ERR!
7:52:53 PM: npm ERR! See /opt/buildhome/.npm/eresolve-report.txt for a full report.
7:52:53 PM: npm ERR! A complete log of this run can be found in:
7:52:53 PM: npm ERR!     /opt/buildhome/.npm/_logs/2022-04-03T18_52_50_009Z-debug-0.log
7:52:53 PM: Error during NPM install
7:52:53 PM: Build was terminated: Build script returned non-zero exit code: 1
7:52:53 PM: Failing build: Failed to build site
7:52:53 PM: Finished processing build request in 9.193144098s

I've been forced to use the --legacy-peer-deps install option to make the site build on my local environment but I don't know of a way to influence the npm install operation on Netlify.

@rob-feat
Copy link

@nwazuo - Until the repo is updated. I found that if you tell Netlify to use Yarn this overcomes the error.

Just add the environment variable
NETLIFY_USE_YARN = true
https://docs.netlify.com/configure-builds/manage-dependencies/#yarn

@RamZallan
Copy link

Would really appreciate a fix here! CC: @sjelfull @rexxars

I could open a PR if someone knows how this would be fixed -- ie just running sanity upgrade?

@fvieira
Copy link

fvieira commented Oct 14, 2022

A safer solution (if using NPM), is to add this to your package.json (and remove it once the peer dependency has been updated):

"overrides": {
  "@sanity/ui": "^0.37.7"
}

This only overrides this specific package, but still errors of other peer dependency conflicts.

@mitchuman
Copy link

Can we get this resolved? It's been over a year now. Anyone maintaining this?

@Jay-Ferguson
Copy link

Jay-Ferguson commented Jul 6, 2024

Seems like this still hasn't been resolved. Has anyone made a PR or heard anything from the maintainer / Sanity team about this? I would like to help out if I can. The dashboard tool and Netlify deploy widget are essential for most websites deployed there as there is currently no bulk deploy / publish function in the default sanity studio. Either integrating a bulk publish feature, or fixing this tool (preferably both). Would make it far more likely for me to use Sanity again and recommend it to other developers & clients.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants