You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/LiveComponent/src/LiveComponentHydrator.php
+8-19Lines changed: 8 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -354,6 +354,10 @@ private function dehydrateValue(mixed $value, LivePropMetadata $propMetadata, ob
354
354
}
355
355
356
356
if ($propMetadata->useSerializerForHydration()) {
357
+
if (!interface_exists(NormalizerInterface::class)) {
358
+
thrownew \LogicException(sprintf('The LiveProp "%s" on component "%s" has "useSerializerForHydration: true", but the Serializer component is not installed. Try running "composer require symfony/serializer".', $propMetadata->getName(), $parentObject::class));
thrownew \LogicException(thrownew \LogicException(sprintf('Unable to dehydrate value of type "%s" for property "%s" on component "%s". Change this to a simpler type of an object that can be dehydrated. Or set the hydrateWith/dehydrateWith options in LiveProp or set "useSerializerForHydration: true" on the LiveProp to use the serializer.', get_debug_type($value), $propMetadata->getName(), $parentObject::class)));
380
382
}
381
383
@@ -433,6 +435,10 @@ private function hydrateValue(mixed $value, LivePropMetadata $propMetadata, obje
433
435
}
434
436
435
437
if ($propMetadata->useSerializerForHydration()) {
438
+
if (!interface_exists(DenormalizerInterface::class)) {
439
+
thrownew \LogicException(sprintf('The LiveProp "%s" on component "%s" has "useSerializerForHydration: true", but the Serializer component is not installed. Try running "composer require symfony/serializer".', $propMetadata->getName(), $parentObject::class));
0 commit comments