Skip to content

πŸ› Bug - tina-astro-starter returns 404 on new contentΒ #17

@tinanoob

Description

@tinanoob

πŸ› Describe the Bug

When running the "tina-astro-starter" locally in development mode,
new entries added to a collection aren't rendered properly after Save.
The entry appears in the list of entries in the collection but clicking on the entry shows a 404 page instead.
This condition persists until tina/astro is restarted manually.

I did not try any other integration, nor did I try Tina Cloud.

πŸ§‘β€πŸ’» Reproduction Steps

  1. cd /tmp
  2. pnpx create-tina-app@latest --template tina-astro-starter
    βœ” Which package manager would you like to use? β€Ί pnpm
    βœ” What is your project named? … my-tina-app
  3. cd my-tina-app
  4. pnpm run dev
  5. open http://localhost:4321/admin/index.html#/collections/blog/~
  6. press Add Files
  7. Enter 'New' for Title, Description, Body and Filename. Choose todays for Publication Date and Updated Date.
  8. Press Save
  9. Observe "New" appears in the Blogs list
  10. Click on the "New" blog just created
  11. Observe browser navigates to url http://localhost:4321/admin/index.html#/~/blog/New
  12. Observe the astro logo and "404: Not found", "Path: /blog/New"
  13. Observe error in the terminal
12:22:46 [WARN] [router] A `getStaticPaths()` route pattern was matched, but no matching static path was found for requested path `/blog/New`.
Possible dynamic routes being matched: src/pages/blog/[...slug].astro, src/pages/[...slug].astro.
12:22:46 [404] /blog/New 3ms
  1. In the terminal, press Ctrl-C
  2. pnpm run dev
  3. Refresh the page in the browser
  4. Observe the http://localhost:4321/admin/index.html#/~/blog/New page renders without error

🎯 Expected Behaviour

The new content should appear after it's created.
The user should not have to manually restart tina/astro after adding a new entry.

If this is a known limitation of the tina-astro integartion, the documentation
https://tina.io/docs/frameworks/astro should point it out.

Possibly related

tinacms/tinacms#2534 reports that restart is required
when adding a new collection, but in this case a restart is required when adding
a new entry to a collection.

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