Skip to content
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

Astro with Sanity gives 404 when refreshing the studio #6479

Closed
layout-ch opened this issue Apr 24, 2024 · 3 comments
Closed

Astro with Sanity gives 404 when refreshing the studio #6479

layout-ch opened this issue Apr 24, 2024 · 3 comments

Comments

@layout-ch
Copy link

Dear Sanity Support Team,
I hope this message finds you well. I am currently experiencing a recurring issue with my Sanity / Astro.js setup, and I would appreciate your assistance in resolving it.
Issue Description:
I have set up Sanity Studio under the path mywebsite.com/studio. The initial access and navigation work as expected, redirecting correctly to mywebsite.com/studio/structure. However, I encounter a significant problem when I refresh the page: it results in a 404 error, indicating that the page cannot be found.
Steps to Reproduce:

  1. Access the Sanity Studio at mywebsite.com/studio.
  2. The page automatically redirects to mywebsite.com/studio/structure.
  3. Refresh the page at mywebsite.com/studio/structure.
  4. A 404 error is displayed.

I understand from community discussions that one potential workaround might involve reverting to version 2.2.1 of the software. However, considering the advancements and features introduced in the latest versions, downgrading seems like an undesirable solution. Maintaining the ability to refresh pages without encountering errors seems fundamental, and I am hoping there might be an alternative solution that allows us to utilize the latest version effectively.
Could you please advise if there is another approach or fix that could resolve this issue without needing to downgrade? Your guidance on how to maintain the stability and functionality of our current setup would be greatly appreciated.

Thank you for your time and assistance.

@largis21
Copy link
Contributor

largis21 commented May 6, 2024

You have to use a rest route, i.e [...studio] not [studio]

@linear linear bot closed this as completed May 17, 2024
@layout-ch
Copy link
Author

its in the astro.config that you define the route, but apparently a known bug that came with the sanity-astro 3.0.0...

@christianhg
Copy link

Exactly. Please try out v 3.0.1 of @sanity/astro. It should solve the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants