diff --git a/.changeset/honest-schools-worry.md b/.changeset/honest-schools-worry.md new file mode 100644 index 000000000000..f8930d63ae9e --- /dev/null +++ b/.changeset/honest-schools-worry.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Check null for props serialization diff --git a/packages/astro/src/runtime/server/serialize.ts b/packages/astro/src/runtime/server/serialize.ts index d15b22ea4a81..59ce96d8ded1 100644 --- a/packages/astro/src/runtime/server/serialize.ts +++ b/packages/astro/src/runtime/server/serialize.ts @@ -48,7 +48,7 @@ function convertToSerializedForm(value: any): [ValueOf, any] { return [PROP_TYPE.JSON, JSON.stringify(serializeArray(value))]; } default: { - if (typeof value === 'object') { + if (value !== null && typeof value === 'object') { return [PROP_TYPE.Value, serializeObject(value)]; } else { return [PROP_TYPE.Value, value];