Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Let the import throw error instead

Fang-Pen Linfbaf8d37a37f
diff --git a/backend/src/server/routes/v1/bdd-nock-router.ts b/backend/src/server/routes/v1/bdd-nock-router.ts
index a2c2def2c1..79d099d669 100644
--- a/backend/src/server/routes/v1/bdd-nock-router.ts
+++ b/backend/src/server/routes/v1/bdd-nock-router.ts
@@ -8,14 +8,10 @@ import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
import { AuthMode } from "@app/services/auth/auth-type";
export const registerBddNockRouter = async (server: FastifyZodProvider) => {
- const importNock = async () => {
+ const importNock = () => {
// Notice: it seems like importing nock somehow increase memory usage a lots, let's import it lazily.
// eslint-disable-next-line import/no-extraneous-dependencies
- const nock = await import("nock");
- if (!nock) {
- throw new InternalServerError({ message: "Failed to import nock" });
- }
- return nock;
+ return import("nock");
};
const checkIfBddNockApiEnabled = () => {