๐Ÿ”ฎ Sanity Create is here. Writing is reinvented. Try now, no developer setup

Discussion of issues with @sanity/generate-help-url and @sanity/block-content-to-hyperscript in an older project

25 replies
Last updated: Sep 1, 2022
Hey everyone, I am having an issue after updating a bit of an older project. I am getting a multiple versions issue for @sanity/generate-help-url. The old version is being called from ./~/@sanity/block-content-to-hyperscript/~/@sanity/generate-help-url, however, I am not using block-content-to-hyperscript anywhere. Wondering if that needs to be updated in the core Sanity package?
Aug 31, 2022, 10:19 PM
@sanity/block-content-to-hyperscript

Aug 31, 2022, 10:25 PM
It looks like the dependencies are outdates in hyperscript
Aug 31, 2022, 10:24 PM
Hey
user K
! Can you try deleting your node_modules and lock file, then reinstalling?
Aug 31, 2022, 10:25 PM
Hey RD, I have done that quite a few times before messaging here. I will give it another go though, this is what my dependencies are at ๐Ÿ™‚
Aug 31, 2022, 10:28 PM
Just deleting and reinstalling now
Aug 31, 2022, 10:29 PM
This may be unrelated since the issue seems to come from your hyperscript plugin, but I wonder if one issue is that block content to react is being deprecated in favor of this new plugin .
Aug 31, 2022, 10:34 PM
Ahh so true, ok thank you ๐Ÿ™‚ I will update that plugin and see if it fixes it up ๐Ÿ™‚
Aug 31, 2022, 10:36 PM
user M
, I am running into this issue when trying to run portable-text Ecmascript modules
Aug 31, 2022, 10:49 PM
Any idea where that would be coming from?
Aug 31, 2022, 10:50 PM
No, and I can't find any mention of that in the repo. I'll keep looking though!
Aug 31, 2022, 10:54 PM
Thank you, I have a feeling it's because this is a very old create react app running in JS not TS. It's a bit of a fragile one, but we are slowly making our way through an update.
Aug 31, 2022, 10:56 PM
I have simplified my setup and rolled back to the last commit where I updated all the @sanity libraries. But now getting an issue that I have had in the past couple of days with sanity-help-url
Aug 31, 2022, 11:05 PM
generateHelpUrl is not a function {"error":{"message":"generateHelpUrl is not a function","name":"TypeError","stack":"TypeError: generateHelpUrl is not a function\n at Object../node_modules/@sanity/client/lib/warnings.js
Aug 31, 2022, 11:05 PM
Ok, looking at this past issue , installing this package may fix it.
Aug 31, 2022, 11:15 PM
This is where it gets into a bit of a loop. If I add the latest package of generate help then block-to-hyperscript throws the multiple packages error with @sanity/block-content-to-hyperscript requiring a lower version of help url. I will give "resolutions" [] a try to see if I can resolve the versions.
We are about to start rebuilding the front end but just need to resolve this update so we can get a backlog bug fixed
๐Ÿ˜„
Aug 31, 2022, 11:26 PM
What version of React are you on?
Aug 31, 2022, 11:30 PM
"react": "^16.9.0",
Aug 31, 2022, 11:52 PM
Yeah it looks like the loop of block-content-to-react -> block-content-to-hyperscript -> @sanity/generate-help-url which requires ^0.140.0.
Is @sanity/block-content-to-hyperscript deprecated now as well as block-content-to-react
Aug 31, 2022, 11:57 PM
No, we're still recommending it.
Aug 31, 2022, 11:59 PM
Are you able to share your repo?
Aug 31, 2022, 11:59 PM
user M
, I would be happy to, but need to be in a private channel as it's a clients repo.
Sep 1, 2022, 12:03 AM
For sure! Feel free to DM me. My day is ending here, though, so I won't be able to take a look until tomorrow.
Sep 1, 2022, 12:54 AM
Hey
user M
, ok no worries at all ๐Ÿ™‚ I have managed to bypass it temporarily by loosening the jest tests for now. I think with the amount of effort to resolve this, knowing there is a rebuild starting very shortly, we might just have to create a few workarounds for now ๐Ÿ™‚
Sep 1, 2022, 12:56 AM
But I will let you know how the testing goes and share the repo tomorrow if I still need. Thanks so much for your help today though
Sep 1, 2022, 12:56 AM
Happy to help! And do let us know if you want more help!
Sep 1, 2022, 2: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?