Skip to content

Commit

Permalink
fix: adaptor export issue
Browse files Browse the repository at this point in the history
  • Loading branch information
b3nten committed Jan 4, 2024
1 parent b7b633b commit 2e28c41
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/adaptors/deno/entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ server.use("*",
server.route("/", entry);

// @ts-ignore - deno namespace
Deno.serve(server.fetch)
Deno.serve(server.fetch)

export default server;
4 changes: 3 additions & 1 deletion src/adaptors/node/entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ console.log(`Listening on port http://localhost:${port}`);
serve({
fetch: server.fetch,
port,
});
});

export default server;
5 changes: 3 additions & 2 deletions src/vite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,14 @@ export default function vono(userConfig?: UserConfig): Array<Plugin> {
if (!vono.ssr) return;
if (check(Function, vono.adaptor.onBuild)) await vono.adaptor.onBuild();
if (vono.prerender.routes.length > 0) {
const handler = await import(
const _handler = await import(
pathe.join(
vono.root,
vono.adaptor.serverDir,
vono.adaptor.entryName + ".js",
)
).then((m) => m.default.fetch);
).then((m) => m.default);
const handler = _handler?.fetch ?? _handler;
await prerender({
handler,
routes: vono.prerender.routes,
Expand Down

0 comments on commit 2e28c41

Please sign in to comment.