summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.changeset/slimy-parrots-exist.md5
-rw-r--r--packages/astro/src/jsx/babel.ts3
-rw-r--r--packages/astro/src/runtime/server/index.ts2
-rw-r--r--packages/astro/src/runtime/server/jsx.ts3
4 files changed, 9 insertions, 4 deletions
diff --git a/.changeset/slimy-parrots-exist.md b/.changeset/slimy-parrots-exist.md
new file mode 100644
index 000000000..36e87c466
--- /dev/null
+++ b/.changeset/slimy-parrots-exist.md
@@ -0,0 +1,5 @@
+---
+'astro': patch
+---
+
+Ensure JSX does not reference server entrypoint
diff --git a/packages/astro/src/jsx/babel.ts b/packages/astro/src/jsx/babel.ts
index 8850dadc1..3482bbf37 100644
--- a/packages/astro/src/jsx/babel.ts
+++ b/packages/astro/src/jsx/babel.ts
@@ -1,9 +1,10 @@
import type { PluginObj } from '@babel/core';
import * as t from '@babel/types';
import { pathToFileURL } from 'node:url';
-import { ClientOnlyPlaceholder } from '../runtime/server/index.js';
import type { PluginMetadata } from '../vite-plugin-astro/types';
+const ClientOnlyPlaceholder = 'astro-client-only';
+
function isComponent(tagName: string) {
return (
(tagName[0] && tagName[0].toLowerCase() !== tagName[0]) ||
diff --git a/packages/astro/src/runtime/server/index.ts b/packages/astro/src/runtime/server/index.ts
index 9604d0b17..1304aca3e 100644
--- a/packages/astro/src/runtime/server/index.ts
+++ b/packages/astro/src/runtime/server/index.ts
@@ -34,8 +34,6 @@ import { Renderer } from './render/index.js';
import { addAttribute } from './render/index.js';
-export const ClientOnlyPlaceholder = 'astro-client-only';
-
// Used in creating the component. aka the main export.
export function createComponent(cb: AstroComponentFactory) {
// Add a flag to this callback to mark it as an Astro component
diff --git a/packages/astro/src/runtime/server/jsx.ts b/packages/astro/src/runtime/server/jsx.ts
index 7bdafe7a2..6041d514d 100644
--- a/packages/astro/src/runtime/server/jsx.ts
+++ b/packages/astro/src/runtime/server/jsx.ts
@@ -2,7 +2,6 @@
import { SSRResult } from '../../@types/astro.js';
import { AstroJSX, isVNode } from '../../jsx-runtime/index.js';
import {
- ClientOnlyPlaceholder,
escapeHTML,
HTMLString,
markHTMLString,
@@ -14,6 +13,8 @@ import {
voidElementNames,
} from './index.js';
+const ClientOnlyPlaceholder = 'astro-client-only';
+
const skipAstroJSXCheck = new WeakSet();
let originalConsoleError: any;
let consoleFilterRefs = 0;