diff --git a/.changeset/pretty-oranges-heal.md b/.changeset/pretty-oranges-heal.md new file mode 100644 index 000000000000..f1b8b38e0bc3 --- /dev/null +++ b/.changeset/pretty-oranges-heal.md @@ -0,0 +1,5 @@ +--- +"astro": patch +--- + +Adds an error message for non-string transition:name values diff --git a/packages/astro/src/runtime/server/transition.ts b/packages/astro/src/runtime/server/transition.ts index ec33e1eae482..755e64417ac2 100644 --- a/packages/astro/src/runtime/server/transition.ts +++ b/packages/astro/src/runtime/server/transition.ts @@ -91,6 +91,9 @@ export function renderTransition( animationName: TransitionAnimationValue | undefined, transitionName: string ) { + if (typeof (transitionName ?? '') !== 'string') { + throw new Error(`Invalid transition name {${transitionName}}`); + } // Default to `fade` (similar to `initial`, but snappier) if (!animationName) animationName = 'fade'; const scope = createTransitionScope(result, hash);