Skip to content

Commit 89cf636

Browse files
committed
fix(rivetkit): fix onError handler not working
1 parent 0ff831e commit 89cf636

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

rivetkit-typescript/packages/rivetkit/src/registry/mod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ export class Registry<A extends RegistryActors> {
222222
// Start server
223223
if (!config.disableDefaultServer) {
224224
const serverPromise = (async () => {
225-
const out = await crossPlatformServe(config, hono, undefined);
225+
const out = await crossPlatformServe(config, hono);
226226
upgradeWebSocket = out.upgradeWebSocket;
227227
})();
228228
readyPromises.push(serverPromise);

rivetkit-typescript/packages/rivetkit/src/registry/serve.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
import { Hono } from "hono";
1+
import type { Hono } from "hono";
22
import { logger } from "./log";
33
import type { RunnerConfig } from "./run-config";
44

55
export async function crossPlatformServe(
66
runConfig: RunnerConfig,
7-
rivetKitRouter: Hono<any>,
8-
userRouter: Hono | undefined,
7+
app: Hono<any>,
98
) {
10-
const app = userRouter ?? new Hono();
11-
129
// Import @hono/node-server using string variable to prevent static analysis
1310
const nodeServerModule = "@hono/node-server";
1411
let serve: any;
@@ -25,10 +22,6 @@ export async function crossPlatformServe(
2522
process.exit(1);
2623
}
2724

28-
// Mount registry
29-
// app.route("/registry", rivetKitRouter);
30-
app.route("/", rivetKitRouter);
31-
3225
// Import @hono/node-ws using string variable to prevent static analysis
3326
const nodeWsModule = "@hono/node-ws";
3427
let createNodeWebSocket: any;
@@ -47,7 +40,7 @@ export async function crossPlatformServe(
4740

4841
// Inject WS
4942
const { injectWebSocket, upgradeWebSocket } = createNodeWebSocket({
50-
app,
43+
app: app,
5144
});
5245

5346
// Start server

0 commit comments

Comments
 (0)