diff options
author | 2024-02-23 15:00:52 +0100 | |
---|---|---|
committer | 2024-02-23 09:00:52 -0500 | |
commit | 459f74bc71748279fe7dce0688f38bd74b51c5c1 (patch) | |
tree | cf63c09f04e91c3e496cf434967760b372f18004 | |
parent | dddbb09fe0928bb10c37f2cf0d3c72113f37741e (diff) | |
download | astro-459f74bc71748279fe7dce0688f38bd74b51c5c1.tar.gz astro-459f74bc71748279fe7dce0688f38bd74b51c5c1.tar.zst astro-459f74bc71748279fe7dce0688f38bd74b51c5c1.zip |
Adds an error message for non-string transition:name values (#10205)
-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); |