Skip to content

HMR and manual refresh 404s admin page #193

@otaviomad

Description

@otaviomad

Describe the bug

This is similar to #155 but not quite. When you open /admin, it suffixes the current page with /structure, so you are in /admin/structure. I presume this is using CSR because no such page exists. When you refresh the page, since /structure only exists "virtually" within the /admin page, it 404s. This happens very often if you're doing HMR.

To Reproduce

Steps to reproduce the behavior:

  1. Setup studioBasePath and sanity.config.ts with structureTool
  2. Navigate to /admin and refresh the page or change a file that would trigger hmr
  3. See error

Expected behavior

/structure should also be a static route.

Logs

21:20:04 [WARN] [router] A `getStaticPaths()` route pattern was matched, but no matching static path was found for requested path `/admin/structure`.

Possible dynamic routes being matched: node_modules/.pnpm/@sanity+astro@3.1.3_@sanity+client@6.19.1_@sanity+visual-editing@2.1.3_@sanity+client@6.19.1__rbvkym4ik5hm3p4hmcrnpgzx4i/node_modules/@sanity/astro/dist/studio/studio-route.astro.

Which versions of Sanity are you using?

@sanity/cli (global)    3.44.0 (up to date)
@sanity/astro            3.1.3 (up to date)
@sanity/visual-editing   2.1.3 (up to date)
sanity                  3.44.0 (up to date)

What operating system are you using?

Bluefin 40

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

pnpm -v && node -v
9.1.4
v20.14.0

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