Skip to content

Async renderTransition() caused Build Failed #13908

@radishzzz

Description

@radishzzz

Astro Info

Astro                    v5.8.2
Node                     v23.11.0
System                   macOS (arm64)
Package Manager          pnpm
Output                   static
Adapter                  none
Integrations             unocss
                         @astrojs/mdx
                         @astrojs/partytown
                         @astrojs/sitemap
                         astro-robots-txt
                         astro-compress

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

Related issue: withastro/compiler#1079

renderTransition() was set to async in Astro 5.9.1 , it causes build failed with the error: "await" can only be used inside an "async" function.

Image

The transition:name isn't always static. After renderTransition() was set to async, we can no longer dynamically use post.id or post.date.title as transition:name values, which seems to be a limitation for the View Transition Name.

What's the expected result?

Build successfully

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-mxp8jccd?file=src%2Fpages%2Findex.astro

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    - P2: has workaroundAn edge case that only affects very specific usage, but has a trivial workaround (priority)feat: view transitionsRelated to the View Transitions feature (scope)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions