diff options
-rw-r--r-- | .changeset/pretty-oranges-heal.md | 5 | ||||
-rw-r--r-- | packages/astro/src/runtime/server/transition.ts | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/.changeset/pretty-oranges-heal.md b/.changeset/pretty-oranges-heal.md new file mode 100644 index 000000000..f1b8b38e0 --- /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 ec33e1eae..755e64417 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); |