Skip to content

Commit

Permalink
handle errors on dyamic import of middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
Neville Mehta authored and Neville Mehta committed Jul 18, 2024
1 parent bc36db5 commit bc26e5b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/integrations/node/src/standalone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ export default async function standalone(app: NodeApp, options: Options) {

// also used by server entrypoint
export async function createStandaloneHandler(app: NodeApp, options: Options) {
const importMiddleware = options.middleware ? await import(options.middleware) : null;
let importMiddleware = null;
try {
importMiddleware = options.middleware ? await import(options.middleware) : null;
} catch (err) {}
const appHandler = createAppHandler(app);
const staticHandler = createStaticHandler(app, options);
return (req: http.IncomingMessage, res: http.ServerResponse) => {
Expand Down

0 comments on commit bc26e5b

Please sign in to comment.