👋 Next.js Conf 2024: Come build, party, run, and connect with us! See all events

Issues with `@sanity/ui` in v3 plugin resolved by switching from Yarn to NPM

20 replies
Last updated: Feb 5, 2023
I upgraded to the latest version of
@sanity/ui
in my v3 plugin and now the builds fail complaining about missing props to every single sanity UI component. It’s fixed by adding these two props to all of them
_onResize_={undefined} _onResizeCapture_={undefined}
😅
Dec 1, 2022, 6:46 AM
I know you want V3 feedback on Github. But not sure if this is V3 or Sanity UI related
Dec 1, 2022, 6:47 AM
It happens in the plugin package itself, not the V3 studio
Dec 1, 2022, 6:47 AM
Then running it in the V3 studio after linking up I get the following errors:

Could not resolve "@reach/auto-id"

Could not resolve "react-popper"

Could not resolve "popper-max-size-modifier"

All imported by Sanity UI lib.

All have the following info after:


You can mark the path "<insert-lib-from-above-list>" as external to exclude it from the bundle,  which will remove this error.
Dec 1, 2022, 7:03 AM
Hello! Can you try updating
@types/react
in your plugin?
Dec 1, 2022, 8:29 AM
Thanks, tried it but it didn’t work 😕
Dec 2, 2022, 12:02 AM
Hello
user S
I just stumbled over this message here, are you still experiencing this issue?
Jan 2, 2023, 4:53 PM
Hey
user J
thanks for checking. I managed to get this working again
Jan 2, 2023, 7:01 PM
What did you do (so when people have the same issue, they can find an answer here 🙂 )
Jan 2, 2023, 7:02 PM
Oh, haha, honestly I don't know. I left it for a few weeks, then tried again. Got different errors and resolved those instead 😅
Jan 2, 2023, 7:04 PM
#caption "programming" spongebob rainbow
Jan 2, 2023, 7:09 PM
hey
user J
this actually wasn’t fixed. The builds stopped failing, but vscode keeps complaining with red squiggly lines on Flex and Box from Sanity UI.
Jan 9, 2023, 1:29 AM
Hadn’t opened the custom input component I built in a while so I didn’t notice until today when I had to dig in there again for a different issue (I’m using the same custom input component on 2 different fields in the same doc but only one gets updated, even when I click the other one)
Jan 9, 2023, 1:30 AM
It might just be a TS issue with sanity/ui, could you try to update the package?
Jan 23, 2023, 11:53 AM
I upgraded sanity/ui but the issue is still there
Jan 24, 2023, 12:02 AM
adding the props removes the warning
Jan 24, 2023, 12:03 AM
latest version of TS (4.9.4)
Jan 24, 2023, 12:04 AM
Just bumping this thread to say I’m also getting this issue in a Sanity project I’m working on.
Feb 3, 2023, 12:19 AM
I still haven’t solved it either
Feb 3, 2023, 1:49 AM
Actually - I think I may have a fix.
user S
Just on a whim, I switched my package management on the project I’m in from Yarn 1.22 to NPM 8.19.3. Knocked out my node_modules and did a full reinstall. Seemingly solved at the moment.
Feb 4, 2023, 12:16 AM
right, so it’s a yarn issue. I’m working on a local plugin that’s currently linked with yalc/yarn link. Would need to update that first to test this out. We’re also using yarn for everything else. So would definitely prefer that it works for both yarn and npm.
user J
it looks like Andy found the cause
Feb 5, 2023, 10:42 PM

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.

Was this answer helpful?