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

Not compatible with the new Sanity v3.41 #85

Open
edison-burnkit opened this issue May 10, 2024 · 8 comments
Open

Not compatible with the new Sanity v3.41 #85

edison-burnkit opened this issue May 10, 2024 · 8 comments

Comments

@edison-burnkit
Copy link

edison-burnkit commented May 10, 2024

I have the following in the Studio package.json. Everything can install without error, but when I run 'npm i sanity-plugin-dashboard-widget-netlify', it gives me some errors. I remember there was no issue with slightly older Sanity (< v3.37).

"dependencies": {
    "@sanity/dashboard": "^3.1.6",
    "@sanity/orderable-document-list": "^1.2.1",
    "@sanity/vision": "^3.41.1",
    "react": "^18.3.1",
    "react-dom": "^18.3.1",
    "react-icons": "^5.2.1",
    "sanity": "^3.41.1",
    "styled-components": "^6.1.11"
  },
  "devDependencies": {
    "@sanity/eslint-config-studio": "^4.0.0",
    "eslint": "^9.2.0",
    "prettier": "^3.2.5",
    "typescript": "^5.4.2"
  },

Errors:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/styled-components
npm ERR!   styled-components@"^6.1.11" from the root project
npm ERR!   peer styled-components@"^5.2 || ^6.0.0" from @sanity/[email protected]
npm ERR!   node_modules/@sanity/dashboard
npm ERR!     @sanity/dashboard@"^3.1.6" from the root project
npm ERR!     peer @sanity/dashboard@"^3.0.0" from [email protected]
npm ERR!     node_modules/sanity-plugin-dashboard-widget-netlify
npm ERR!       sanity-plugin-dashboard-widget-netlify@"*" from the root project
npm ERR!   1 more (sanity)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer styled-components@"^5.2" from [email protected]
npm ERR! node_modules/sanity-plugin-dashboard-widget-netlify
npm ERR!   sanity-plugin-dashboard-widget-netlify@"*" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

This dependency hasn't been updated for more than a year, which I assume is the issue because other dependencies keep updating, like sanity and styled-components (v5->v6). Is there a way I can keep using this widget with up to date everything else? Is there an alternative tool for Gatsby/Sanity projects hosted on Netlify?

@edison-burnkit edison-burnkit changed the title Not compatible with the new Sanity v 3.41 Not compatible with the new Sanity v3.41 May 10, 2024
@slegay
Copy link

slegay commented Jun 4, 2024

If this plugin no longer maintained by the Sanity team?

@violeta-p
Copy link

I am experiencing the same issue and haven't been able to find a workaround either. If anyone has any information or suggestions, I would greatly appreciate it. 🙏

@doublejosh
Copy link

@violeta-p the workaround is --legacy-peer-deps

@Jay-Ferguson
Copy link

Jay-Ferguson commented Jul 6, 2024

@violeta-p the workaround is --legacy-peer-deps

That does not seem to work for me it still results in an undefined run time error when opening the sanity studio locally or after it is deployed. "Error: Cannot destructure property 'container' of 'n.sanity' as it is undefined."

Just in case anyone is facing the same error, installing two versions of styled components with an alias for V5 was the way around this issue for me.

@edison-burnkit
Copy link
Author

I am experiencing the same issue and haven't been able to find a workaround either. If anyone has any information or suggestions, I would greatly appreciate it. 🙏

@violeta-p the workaround is --legacy-peer-deps

That does not seem to work for me it still results in an undefined run time error when opening the sanity studio locally or after it is deployed. "Error: Cannot destructure property 'container' of 'n.sanity' as it is undefined."

Just in case anyone is facing the same error, installing two versions of styled components with an alias for V5 was the way around this issue for me.

Did you try --force? It was the workaround for me, but this should be temporary. I reported the issue more than 2 months ago, and I thought it was a 'quick fix'...

@usaamatahir
Copy link

installing two versions of styled components with an alias

@Jay-Ferguson Can you please explain the solution.

I'm facing the same error at runtime. Its giving undefined error.

image

@jonohewitt
Copy link

It seems like this widget has been abandoned - I've swapped to https://github.com/jclusso/sanity-plugin-netlify and would recommend it, seems like an upgrade all round.

@usaamatahir
Copy link

@jonohewitt Thanks

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

7 participants