Skip to content

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

@narration-sd

Description

@narration-sd

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions