Closed narration-sd closed 3 months ago
Hi @narration-sd
Looking at the @sanity/astro
code, it expects studioBasePath
to be a relative path. See the code here. That's where it's injecting the route which is causing the problem. Is there a reason you're expecting the full URL to work?
Hi @ascorbic , Matt,
Very interesting. Early here, and will be looking into this.
I'll come back to you, and quite appreciate the rapid response; wanted here to also respect your time zone, which for some years was once mine :).
No problem. I'm going to close this now, because any further discussion would be best taken to the Sanity repo.
Astro Info
If this issue only occurs in one browser, which browser is a problem?
not a browser issue
Describe the Bug
The crash occurs immediately on startup, when a path in @sanity/astro integration config is given a full protocol-domain url signature. A simple slashes path does not cause the breakage.
Looking at the Astro code involved from the stack trace, it seems the experimental code for Containers is being run, though no containers are called for, and that this code may be treating the Sanity config as a route, which it fails on due to the full protocol-domain form. None of this should be involved, and the url is not a route for the application.
Here's the stack trace:
Here is the astro.config config segment where the integration's erroring path item is introduced -- as
studioBasePath
. The similarly configured item stega.studioUrl does not cause the crash, and studioBasePath is also safe if the preview url is commented out of its construction.PUBLIC_SANITY_STUDIO_PREVIEW_URL is
http://localhost:4321
, and PUBLIC_SANITY_STUDIO_BASE_PATH: is/admin
});
What's the expected result?
The app should simple launch and operate as a simple blog website, as it does when
studioBasePath
is a simple path and not a full protocol-domain url.Stackblitz demo is included -- create the .env file with contents in the README to run it,
npm run dev
and immediately get the crash.Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-gpdyg7?file=README.md
Participation