diff --git a/src/lib/DefaultPromiseErrorHandler.ts b/src/lib/DefaultPromiseErrorHandler.ts index 96131f93..6a9c3740 100644 --- a/src/lib/DefaultPromiseErrorHandler.ts +++ b/src/lib/DefaultPromiseErrorHandler.ts @@ -7,7 +7,7 @@ */ export const defaultPromiseErrorHandler = (name: string) => (error: any) => { - if (process.env.NODE_ENV === 'production') { + if (import.meta.env.PROD) { return; } diff --git a/src/lib/requests/client/BaseClient.ts b/src/lib/requests/client/BaseClient.ts index 2929f8a4..6b5855b1 100644 --- a/src/lib/requests/client/BaseClient.ts +++ b/src/lib/requests/client/BaseClient.ts @@ -17,7 +17,7 @@ export abstract class BaseClient { const { hostname, port, protocol } = window.location; // if port is 3000 it's probably running from webpack development server - const inferredPort = port === '3000' ? '4567' : port; + const inferredPort = import.meta.env.DEV && port === '3000' ? '4567' : port; return AppStorage.local.getItemParsed('serverBaseURL', `${protocol}//${hostname}:${inferredPort}`); }