From 1545f918191bd53fe787db9d9c6753308007fb43 Mon Sep 17 00:00:00 2001 From: Michael Schwobe Date: Tue, 12 Dec 2023 12:51:54 -0600 Subject: [PATCH] Fix/Revert `msw` conditions to use global env instead of process env --- app/entry.server.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/entry.server.tsx b/app/entry.server.tsx index 38cd644..819fa2c 100644 --- a/app/entry.server.tsx +++ b/app/entry.server.tsx @@ -17,11 +17,11 @@ init(); global.ENV = getEnv(); // Enable API mocking. -if (ENV.MODE !== "production" && ENV.MOCKS === true) { +if (process.env.NODE_ENV !== "production" && process.env.MOCKS === "true") { const { server } = await import("../tests/mocks/node"); server.listen(); console.info("[MSW] Mocking enabled."); - if (ENV.MODE === "development") { + if (process.env.NODE_ENV === "development") { // Only log mocked requests in development mode. server.events.on("request:start", ({ request }) => { console.info(request.method, "[MSW]", request.url);