treefarmstudio / astro-sanity

This is a helper package to integrate Astro and Sanity
https://www.npmjs.com/package/astro-sanity
MIT License
102 stars 10 forks source link

@sanity/client export warning #24

Closed alexpi closed 11 months ago

alexpi commented 1 year ago

Hello. I am getting an "The default export of @sanity/client has been deprecated. Use the named export createClient instead" warning after starting my app. Is this an update that needs to be done on your part?

VojtaStruhar commented 1 year ago

I get the same error. I made a pull request for this: #25

Let me know if it fixes it for you please.

alexpi commented 1 year ago

@VojtaStruhar Sorry, I can't test your fix, I ended up using Sanity's official JS client instead of astro-sanity.

grojas2525 commented 1 year ago

Hi there! How can I implement the fix? I was hoping to use astro-sanity

VojtaStruhar commented 1 year ago

Hi. You could download my fork that has the fix (see the pull request), run npm build and then link astro-sanity manually. But this only works on your machine, if you are using cloud build (like with how Vercel pulls projects from github), this will still fail.

Since the owner doesn't seem to maintain this repo very much, I'd say don't use astro-sanity. Their official astro app template doesn't use it either. If you look at the source code, it's mostly a thin wrapper over the sanity package.

grojas2525 commented 1 year ago

Thank you Vojtech, do you mean that I should click into the #25 pull request, then "check out" with GitHub CLI (ommand gh pr checkout 25)? If so, should I be in the root folder of the project? Thank you for your help.

42ae commented 1 year ago

@jaydanurwin would be nice to see PR #25 merged 😉

VojtaStruhar commented 1 year ago

Sorry for the delay @grojas2525

Thank you Vojtech, do you mean that I should click into the #25 pull request, then "check out" with GitHub CLI (ommand gh pr checkout 25)? If so, should I be in the root folder of the project? Thank you for your help.

Yeah, clone the repo on my account, run npm build and then instead of npm installing astro-sanity as you would, you link the cloned and built package instead.

As I said, this will not work if you are building in a cloud (like Vercel does). But if you do your build on your machine, you can do npm build on your astro website and then upload the built result yourself.. Astro is just awesome like that :)

Haiko-E commented 11 months ago

@jaydanurwin would be nice to see this one merged

jaydanurwin commented 11 months ago

Thanks for the ping @Haiko-E! I just merged it but I did want to send out a friendly reminder that this package has been deprecated in favor of the official Astro integration from Sanity. Best of luck to you and what you're building!

https://www.sanity.io/plugins/sanity-astro

Haiko-E commented 11 months ago

Thx for the merge. I didn't know there was a official astro-sanity plugin, so thx for the heads-up. Gonna check it out.

Kind regards Haiko

Op do 5 okt. 2023 16:25 schreef Jaydan Urwin @.***>:

Thanks for the ping @Haiko-E https://github.com/Haiko-E! I just merged it but I did want to send out a friendly reminder that this package has been deprecated in favor of the official Astro integration from Sanity. Best of luck to you and what you're building!

https://www.sanity.io/plugins/sanity-astro

— Reply to this email directly, view it on GitHub https://github.com/littlesticks/astro-sanity/issues/24#issuecomment-1749018566, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATI3QEX3MRL5NJCUYLMBZWTX527PNAVCNFSM6AAAAAAY4EVOQGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBZGAYTQNJWGY . You are receiving this because you were mentioned.Message ID: @.***>