Skip to content

Using vite plugin node for svelte kit #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export declare type RequestAdapter<App = any> = (
app: App,
req: http.IncomingMessage,
res: http.ServerResponse,
next: (err?: Error) => void,
server: ViteDevServer
) => void | Promise<void>;

Expand Down
5 changes: 3 additions & 2 deletions src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ export const createMiddleware = (

return async function (
req: http.IncomingMessage,
res: http.ServerResponse
res: http.ServerResponse,
next: (err?: Error) => void,
): Promise<void> {
const appModule = await server.ssrLoadModule(config.appPath);
let app = appModule[config.exportName!];
Expand All @@ -79,7 +80,7 @@ export const createMiddleware = (
} else {
// some app may be created with a function returning a promise
app = await app;
await requestHandler(app, req, res, server);
await requestHandler(app, req, res, next, server);
}
};
};