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

Attempting to path a separate Studio will cause Astro to crash with uninformative message #210

Open
narration-sd opened this issue Aug 18, 2024 · 0 comments

Comments

@narration-sd
Copy link
Contributor

Describe the bug

The current code assumes use of its embedded Studio ability, and will cause a seeming Astro error if a fully pathed Studio url is attempted. However, after discussion with them, it's clear the problem is that @sanity/astro is in this case attempting to add an Astro route which is not within the Astro app, which it properly rejects.

This report will be referenced by a simple PR which avoids this problem, allowing separate Studios to be used.

To Reproduce

  1. in a Sanity Astro project's astro.config, set studioBasePath to any full protocol-domain url (e.g. http://localhost:3333), rather than the usual path only (e.g. /admin)
  2. attempt to start the app in dev
  3. Note a crash occurs, with a spurious-seeming error from Astro

Expected behavior

A full protocol-domain url studioBasePath should be always accepted, and operate as expected if it points to an available Sanity Studio.

Which versions of Sanity are you using?

$ sanity versions
@sanity/cli (global) 3.53.0 (latest: 3.54.0)
@sanity/prettier-config 1.0.2 (up to date)

What operating system are you using?
Windows 11 very latest

Which versions of Node.js / npm are you running?

$ pnpm -v && node -v
9.1.2
v20.11.1

Additional context

@sanity/[email protected]

Security issue?

none

narration-sd added a commit to narration-sd/sanity-astro that referenced this issue Aug 18, 2024
… the blog folder to go through steps of setting it up. The entire repo has been updated to recent Sanity and Astro versions, to avoid recent problems and those with mixed app requirements. So be sure to build the package first, as it is used by blog and others rather than the published package. The fix is included from PR sanity-io#210.
narration-sd added a commit to narration-sd/sanity-astro that referenced this issue Aug 18, 2024
… the blog folder to go through steps of setting it up. The entire repo has been updated to recent Sanity and Astro versions, to avoid recent problems and those with mixed app requirements. So be sure to build the package first, as it is used by blog and others rather than the published package. The fix is included from PR sanity-io#210. Pick up also the pnpm-lock.json, this push....
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

1 participant