Skip to content

Commit

Permalink
Remove top level await
Browse files Browse the repository at this point in the history
And add promise rejection handler to satisfy eslint.
  • Loading branch information
mpanne committed Feb 12, 2025
1 parent f9905ad commit 5f1c47b
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions packages/dito/app/entry.server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,19 @@ import logResponseStatus from "utils/logging";
import { NonceProvider } from "utils/nonce";

if (process.env.MOCK_EXTERNAL_APIS && process.env.NODE_ENV !== "production") {
await import("mocks/node").then(({ mockServer }) => {
console.warn("Mock external APIs.");
mockServer.listen({
// This is going to perform unhandled requests
// but print no warning whatsoever when they happen.
onUnhandledRequest: "bypass",
});
});
import("mocks/node").then(
({ mockServer }) => {
console.warn("Mock external APIs.");
mockServer.listen({
// This is going to perform unhandled requests
// but print no warning whatsoever when they happen.
onUnhandledRequest: "bypass",
});
},
() => {
console.error("Failed to mock external APIs.");
},
);
}

const ABORT_DELAY = 5_000;
Expand Down

0 comments on commit 5f1c47b

Please sign in to comment.