Error caused by multiple versions of @sanity/ui installed
17 replies
Last updated: Jan 28, 2021
J
I just updated the studio to
^2.2.3and I have this error as soon I open a document π
Jan 26, 2021, 6:19 PM
J
Component stack below:
Jan 26, 2021, 6:20 PM
J
I too updated locally to
^2.2.3and got this message
The above error occurred in the <Card> component: in Card (created by DocumentPanel) in DocumentPanel (created by DocumentPane) in div (created by DocumentPane) in div (created by ForwardRef(ScrollContainer)) in ForwardRef(ScrollContainer) (created by EnabledChangeConnectorRoot) in Tracker (created by EnabledChangeConnectorRoot) in EnabledChangeConnectorRoot (created by DocumentPane) in div (created by KeyboardShortcutResponder) in KeyboardShortcutResponder (created by GetHookCollectionState) in GetHookCollectionState (created by RenderActionCollectionState) in RenderActionCollectionState (created by DocumentActionShortcuts) in DocumentActionShortcuts (created by DocumentPane) in DocumentPane (created by DocumentPaneProvider) in DocumentHistoryProvider (created by DocumentPaneProvider) in DocumentPaneProvider in StreamingComponent in StreamingComponent (created by Context.Consumer) in WithInitialValueWrapper (created by DeskToolPane) in DeskToolPane (created by DeskToolPanes) in SplitPaneWrapper (created by DeskToolPanes) in div (created by Pane) in Pane (created by SplitPane) in div (created by SplitPane) in SplitPane (created by PanesSplitController) in div (created by PanesSplitController) in div (created by Pane) in Pane (created by SplitPane) in div (created by SplitPane) in SplitPane (created by PanesSplitController) in div (created by PanesSplitController) in PanesSplitController (created by DeskToolPanes) in div (created by DeskToolPanes) in DeskToolPanes (created by DeskTool) in DeskTool (created by withRouter(DeskTool)) in withRouter(DeskTool) (created by DeskToolPaneStateSyncer) in DeskToolPaneStateSyncer (created by DeskTool) in DeskToolFeaturesProvider (created by DeskTool) in DeskTool (created by RenderTool) in RenderTool (created by SchemaErrorReporter) in RouteScope (created by SchemaErrorReporter) in div (created by SchemaErrorReporter) in div (created by SchemaErrorReporter) in div (created by SchemaErrorReporter) in SchemaErrorReporter (created by DefaultLayout) in DefaultLayout (created by withRouter(DefaultLayout)) in withRouter(DefaultLayout) (created by DefaultLayoutRoot) in RouterProvider (created by DefaultLayoutRoot) in LoginWrapper (created by DefaultLayoutRoot) in DefaultLayoutRoot (created by AppProvider) in div (created by styled.div) in styled.div (created by Box) in Box (created by Styled(Box)) in Styled(Box) (created by Card) in Ge (created by ThemeProvider) in ThemeProvider (created by ThemeColorProvider) in ThemeColorProvider (created by Card) in Card (created by Styled(Card)) in Styled(Card) (created by AppProvider) in SnackbarProvider (created by AppProvider) in LayerProvider (created by AppProvider) in PortalProvider (created by AppProvider) in UserColorManagerProvider (created by AppProvider) in AppProvider (created by SanityRoot) in Ge (created by ThemeProvider) in ThemeProvider (created by SanityRoot) in SanityRoot in AppContainer React will try to recreate this component tree from scratch using the error boundary you provided, RenderTool. react_devtools_backend.js:2430:23
Jan 26, 2021, 10:55 PM
P
Thanks all, we're investigating this at the moment.
Jan 27, 2021, 9:19 AM
J
This is caused by having multiple versions of
@sanity/uiinstalled. You can work around it by making sure to install the same version of
@sanity/uias the one
@sanity/baseinstalls π We're working on a better solution for this π
Jan 27, 2021, 9:44 AM
J
npm install @sanity/ui@0.32.8
Jan 27, 2021, 9:46 AM
J
Awesome. Thanks for the quick work π
Jan 27, 2021, 1:52 PM
J
I tried this, still getting the same issue π€ i also tried deleting my node_modules and yarn.lock without any success
Jan 27, 2021, 9:43 PM
J
Yeah, it created a different issue for me (reported in different thread in sanity-ui)
Jan 27, 2021, 9:44 PM
J
π I tried to revert all my changes and now i cant even access my studio anymore...
Jan 27, 2021, 10:02 PM
J
second problem was fixed after i deleted my node_modules >.>
Jan 27, 2021, 10:07 PM
J
user S
that grayerror was the same one I hit after
yarn add @sanity/ui@0.32.8. Youβre saying deleting your node modules resolved the issue? Then did you run
yarn addto add everything back?
Jan 27, 2021, 10:09 PM
J
so i reverted all my changes to package to the version before updating sanity, then yes delete the node modules, aswell as package.lock or yarn.lock
Jan 27, 2021, 10:10 PM
J
oh gotcha, so you were unable to get their fix to work?
Jan 27, 2021, 10:11 PM
J
Luckily Iβm ok with my broken updated branch and can work on something else while waiting for a fix π
Jan 27, 2021, 10:11 PM
J
It if helps, the new version of the sanity-plugin-media was also responsible for the crash. After reverting both sanity and the media plugin, Iβm back to business π
Jan 27, 2021, 10:26 PM
J
For those of you still struggling after installing an older version of
1. Try removing
This will find all
(Notice top is different from all the others)
This should let you identify if other plugins (etc.) install a different version.
@sanity/uimanually. I'm thinking maybe there is some other package depending on
@sanity/uiwhich could have a different version. Or maybe "something" is overriding you so when you install you still effectively end up with different versions.
1. Try removing
node_modulesthat should be a good bet in most cases2. If problem persist search your
node_modulesdirectory to see which versions of
@sanity/uireside in it. I've written a
find-command you can use:
$ find node_modules -type d -iname 'ui*' -exec grep --with-filename 'version": ' {}/package.json \;
@sanity/uidirectories and print the
versionfrom
package.json. For instance in this studio where I've installed different versions on purpose:
β― find node_modules -type d -iname 'ui*' -exec grep --with-filename 'version": ' {}/package.json \; node_modules/@sanity/ui/package.json: "version": "0.33.0" node_modules/@sanity/desk-tool/node_modules/@sanity/ui/package.json: "version": "0.32.9" node_modules/@sanity/form-builder/node_modules/@sanity/ui/package.json: "version": "0.32.9" node_modules/@sanity/base/node_modules/@sanity/ui/package.json: "version": "0.32.9"
This should let you identify if other plugins (etc.) install a different version.
Jan 28, 2021, 7:43 AM
Sanityβ build remarkable experiences at scale
Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.