Skip to content

Commit e031fe8

Browse files
committed
enable node streams in bun and deno
1 parent 432f2e3 commit e031fe8

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

packages/start/src/config/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,17 @@ export function solidStart(options?: SolidStartOptions): Array<PluginOption> {
5757
configEnvironment(name) {
5858
return {
5959
resolve: {
60+
noExternal: ["h3"],
6061
// remove when https://github.com/solidjs/vite-plugin-solid/pull/228 is released
6162
externalConditions: ["solid", "node"],
6263
},
6364
};
6465
},
6566
async config(_, env) {
67+
_.ssr ??= {};
68+
_.ssr.resolve ??= {};
69+
_.ssr.resolve.conditions ??= [];
70+
_.ssr.resolve.conditions.push("generic");
6671
const clientInput = [handlers.client];
6772
if (env.command === "build") {
6873
const clientRouter: BaseFileSystemRouter = (globalThis as any).ROUTERS.client;

packages/start/src/server/handler.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { matchAPIRoute } from "./routes.ts";
1212
import { handleServerFunction } from "./server-functions-handler.ts";
1313
import type { APIEvent, FetchEvent, HandlerOptions, PageEvent } from "./types.ts";
1414
import { getExpectedRedirectStatus } from "./util.ts";
15+
import { FastResponse } from "srvx/node";
1516

1617
const SERVER_FN_BASE = "/_server";
1718

@@ -114,7 +115,7 @@ export function createBaseHandler(
114115
// using TransformStream in dev can cause solid-start-dev-server to crash
115116
// when stream is cancelled
116117
// send fast node streams (for now this is only available in nodejs)
117-
if (e.runtime?.name === "node") return stream;
118+
if (e.runtime?.name === "node") return new FastResponse(stream);
118119

119120
// returning stream directly breaks cloudflare workers
120121
const { writable, readable } = new TransformStream();

0 commit comments

Comments
 (0)