diff --git a/packages/astro/test/container.test.js b/packages/astro/test/container.test.js
index a054b819c8..e8699460f7 100644
--- a/packages/astro/test/container.test.js
+++ b/packages/astro/test/container.test.js
@@ -1,5 +1,5 @@
import assert from 'node:assert/strict';
-import { before, describe, it } from 'node:test';
+import { after, before, describe, it } from 'node:test';
import { experimental_AstroContainer } from '../dist/container/index.js';
import {
Fragment,
@@ -233,7 +233,29 @@ describe('Container', () => {
});
});
-describe('Container with renderers', () => {
+describe('Container with renderers, DEV', () => {
+ let fixture;
+ let devServer;
+ before(async () => {
+ fixture = await loadFixture({
+ root: new URL('./fixtures/container-custom-renderers/', import.meta.url),
+ });
+ devServer = await fixture.startDevServer();
+ });
+
+ after(async () => {
+ await devServer.stop();
+ });
+
+ it('the endpoint should return the HTML of the React component', async () => {
+ const response = await fixture.fetch('/button-directive');
+ const html = await response.text();
+
+ assert.match(html, /I am a react button/);
+ });
+});
+
+describe.skip('Container with renderers, SSR', () => {
let fixture;
let app;
before(async () => {
@@ -262,7 +284,7 @@ describe('Container with renderers', () => {
assert.match(html, /I am a vue button/);
});
- it('Should render a component with directives', async () => {
+ it.skip('Should render a component with directives', async () => {
const request = new Request('https://example.com/button-directive');
const response = await app.render(request);
const html = await response.text();
diff --git a/packages/astro/test/fixtures/container-custom-renderers/package.json b/packages/astro/test/fixtures/container-custom-renderers/package.json
index fa096126e6..37c42be3cc 100644
--- a/packages/astro/test/fixtures/container-custom-renderers/package.json
+++ b/packages/astro/test/fixtures/container-custom-renderers/package.json
@@ -3,10 +3,12 @@
"version": "0.0.0",
"private": true,
"type": "module",
- "dependencies": {
+ "devDependencies": {
"@astrojs/react": "workspace:*",
"@astrojs/vue": "workspace:*",
- "astro": "workspace:*",
+ "astro": "workspace:*"
+ },
+ "dependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1",
"vue": "^3.4.31"
diff --git a/packages/astro/test/fixtures/container-custom-renderers/src/components/buttonDirective.astro b/packages/astro/test/fixtures/container-custom-renderers/src/components/buttonDirective.astro
index 01b6a03dfa..f9058a85c8 100644
--- a/packages/astro/test/fixtures/container-custom-renderers/src/components/buttonDirective.astro
+++ b/packages/astro/test/fixtures/container-custom-renderers/src/components/buttonDirective.astro
@@ -2,4 +2,4 @@
import Button from "./button.jsx"
---
-
+
diff --git a/packages/astro/test/fixtures/container-custom-renderers/src/pages/button-directive.ts b/packages/astro/test/fixtures/container-custom-renderers/src/pages/button-directive.ts
index 910853014d..2f807905ab 100644
--- a/packages/astro/test/fixtures/container-custom-renderers/src/pages/button-directive.ts
+++ b/packages/astro/test/fixtures/container-custom-renderers/src/pages/button-directive.ts
@@ -1,12 +1,22 @@
import type { APIRoute, SSRLoadedRenderer } from 'astro';
import { experimental_AstroContainer } from 'astro/container';
-import renderer from '@astrojs/react/server.js';
+import { loadRenderers } from 'astro:container';
+import { getContainerRenderer as r } from '@astrojs/react';
+import { getContainerRenderer as v } from '@astrojs/vue';
import Component from '../components/buttonDirective.astro';
export const GET: APIRoute = async (ctx) => {
- const container = await experimental_AstroContainer.create();
- container.addServerRenderer({ renderer });
- return await container.renderToResponse(Component, {
- skipClientDirectives: true,
+ try {
+ const renderers = await loadRenderers([v(), r()]);
+ } catch (e) {
+ console.log(e);
+ }
+ return new Response(null, {
+ status: 200,
});
+ // const container = await experimental_AstroContainer.create({
+ // renderers,
+ // });
+ // container.addServerRenderer({ renderer });
+ // return await container.renderToResponse(Component);
};
diff --git a/packages/integrations/react/package.json b/packages/integrations/react/package.json
index 16ae0b279f..7a9a24fda7 100644
--- a/packages/integrations/react/package.json
+++ b/packages/integrations/react/package.json
@@ -25,7 +25,7 @@
"./client.js": "./client.js",
"./client-v17.js": "./client-v17.js",
"./server.js": {
- "default": "./server.js",
+ "import": "./server.js",
"types": "./server.d.ts"
},
"./server-v17.js": {