-
Notifications
You must be signed in to change notification settings - Fork 20
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
2.7.0 breaks Astro visual editing support #2150
Comments
Facing the similar kind of issue. After doing some research i found some solution related lodash package, so in vite config i added this in astro.config file This solved my issue my visual-editing-component (overlays) worked fine but in studio i faced different issue which is Then in presentation tool, it shows this |
@maazuddindenovers I have the exact same problem with the visual editor where the first edit just works and shows. When making a second edit, it just crashes. This is not only on 2.7.0 version but also on older versions like 2.4.1 etc... |
@DavithkbY , Yeah, i have also tried multiple older version, but there are still some kind of errors, Not sure I think these issues are causing with some dependents/dependencies and someone also look into this package also is this related to this package @sanity/astro or not. |
I think this issue is likely related to |
Hi @rdunk do you mean 2.7.1? With version 2.7.1 it's still broken: My package.json:
|
@rdunk I tried it again and it does seem fixed now with 2.7.1 amazing! |
@DavithkbY Awesome! Glad to hear it and thanks for reporting. |
@rdunk it randomly stopped working locally again. Nothing changes in the codebase literally 0 lines of code very weird.
|
Just possibly another clue turns up.
Now. I tried this out. App -- fine. Studio on /admin -- looked fine at first. But, it failed to Live Edit actually, and after a while gave the prompt you've seen that it couldn't connect, which is studio to app. In the console.log, this is logged, along eventually with the usual heartbeat no response. But: there is something else, seemingly taking a while to show up: an Uncaught Error: path is required....and this having to do with ResolveEditInfo, which I seem to find inside the visual-editing package code. This looks like a bit of a hot clue, and you can see it all on the screenshot I'm attaching. Hope it helps. Once again, this occurs on Vercel, but not on dev, and with the environmental config look like it is correct. The console indication is something missing, not mis-set.... The repo for this, if useful, is https://github.com/narration-sd/sanity-astro/tree/narration-sd/added-blog-example-vercel |
@DavithkbY I was facing this issue, so i looked into it
I found that in nodemoules at this path but in lodash package So i found out that i can use the "lodash-es" for ES module so i installed and then configured vite in astro config
but not sure, it is the right solution or not but @rdunk can tell more on this. |
@maazuddindenovers Maaz, I'm suspecting your lodash situation has been something to do with your app, rather than this sanity-astro issue. I see no such errors, but put in your alias to lodash-es, which seems accepted (as long as I add it to pnpm), but makes no changes I can see to the no-visual-editing problem -- but was a good thought :) I pushed further on what appears here, by creating a Netlify-compatible config, and deploying on Netlify. This fails to visual edit also, just as we've been seeing, and has the same logging of 'uncaught Error: path is required'. The image is this time is from Chrome latest, instead of Firefox latest, but the result is the same, as you can see below.
Ok. I have to leave it, hopefully with more clues. The Netlify version including trial steps today is here. |
OK, I felt to hit this one more time late in evening -- and now can demo the bug locally rather than on deploy serverless, so it should be much easier to troubleshoot. This is done by using the Astro Node adapter, which allows SSR locally after a normal build. And running that way shows the same error it appears precisely, as occurs deployed -- website pane can't connect, and the 'path is required' error shows in the console, with effectively the same stack trace, when you hover mouse over it, as before. Here's the repo branch (and all of these have sample content in the apps/blog/content folder) The requisite screenshot, back on Firefox this time. Other variations on using local serverless clis have been tried, none of which allowed this local error demonstration. A certain amount of LLM discussing was useful, helping along, and it finally suggested trying this Node approach, which does the trick.. |
@narration-sd I think you have a different problem. The solution of @maazuddindenovers by adding lodash-es does solve my problem. And I have no more errors. |
Okay nevermind. Applying @maazuddindenovers his fix only fixes the issue on my local version. On Netlify I have the same 'path' error as @narration-sd |
@rdunk, I hope this is all clear enough by the end for you....
|
@rdunk , The issue is mentioned/explained by @narration-sd using node adapter in local and on netlify, That is also replicating for me |
Ok, I have just verified that @sanity/[email protected] allowing Vercel and Netlify deployments to do Presentation operations again properly, as well as under the Node adapter on a local build. The work is based on @DavithkbY having brought up the new version as possible fix on our Slack discussion. You can find my projects as before under my fork https://github.com/narration-sd/sanity-astro, where there are branches named for each of the deployment types, and including sample content that works with each. The path to getting all three to work was complicated by some apparent configuration errors in the @sanity/sanity-astro repo.
I left these faults in my examples so they can be seen, but manually updated the peer dependency in order to create a working project on each branch, testing them on actual deploys, where they work normally now. I'm not issuing @sanity/sanity-astro because the Sanity dev team would probably rather choose corrections themselves, as they appear to be a direct part of the problems worked on here. @rdunk, let me know if you want something else, thanks. The extra problems I've detailed here occur for any project built in or added to the @sanity/sanity-astro monorepo. |
@rdunk Rupert, et al, I've produced an issue over the @sanity/astro problem and fix for success in applying 2.8.0. |
The visual editor is broken in Astro with 2.7.0 and also 2.6.0:
The text was updated successfully, but these errors were encountered: