summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.changeset/yellow-lizards-shout.md5
-rw-r--r--packages/astro/src/runtime/server/render/astro.ts4
2 files changed, 7 insertions, 2 deletions
diff --git a/.changeset/yellow-lizards-shout.md b/.changeset/yellow-lizards-shout.md
new file mode 100644
index 000000000..10974c86c
--- /dev/null
+++ b/.changeset/yellow-lizards-shout.md
@@ -0,0 +1,5 @@
+---
+'astro': patch
+---
+
+Added a warning in build when trying to hydrate an Astro component
diff --git a/packages/astro/src/runtime/server/render/astro.ts b/packages/astro/src/runtime/server/render/astro.ts
index 3283669c0..077bc6ca2 100644
--- a/packages/astro/src/runtime/server/render/astro.ts
+++ b/packages/astro/src/runtime/server/render/astro.ts
@@ -8,9 +8,9 @@ import { isPromise } from '../util.js';
import { renderChild } from './any.js';
import { HTMLParts } from './common.js';
-// In dev mode, check props and make sure they are valid for an Astro component
+// Issue warnings for invalid props for Astro components
function validateComponentProps(props: any, displayName: string) {
- if (import.meta.env?.DEV && props != null) {
+ if (props != null) {
for (const prop of Object.keys(props)) {
if (HydrationDirectiveProps.has(prop)) {
// eslint-disable-next-line