diff --git a/src/services/provider/Firebase.ts b/src/services/provider/Firebase.ts index d28b2e5f..019a9ce5 100644 --- a/src/services/provider/Firebase.ts +++ b/src/services/provider/Firebase.ts @@ -53,13 +53,13 @@ import * as crypto from 'crypto'; import { IBootloaderType } from '../firmware/Types'; const config = { - apiKey: process.env.REACT_APP_FIREBASE_API_KEY, - authDomain: process.env.REACT_APP_FIREBASE_AUTH_DOMAIN, - projectId: process.env.REACT_APP_FIREBASE_PROJECT_ID, - storageBucket: process.env.REACT_APP_FIREBASE_STORAGE_BUCKET, - messagingSenderId: process.env.REACT_APP_FIREBASE_MESSAGE_SENDER_ID, - appId: process.env.REACT_APP_FIREBASE_APP_ID, - measurementId: process.env.REACT_APP_FIREBASE_MEASUREMENT_ID, + apiKey: import.meta.env.REACT_APP_FIREBASE_API_KEY, + authDomain: import.meta.env.REACT_APP_FIREBASE_AUTH_DOMAIN, + projectId: import.meta.env.REACT_APP_FIREBASE_PROJECT_ID, + storageBucket: import.meta.env.REACT_APP_FIREBASE_STORAGE_BUCKET, + messagingSenderId: import.meta.env.REACT_APP_FIREBASE_MESSAGE_SENDER_ID, + appId: import.meta.env.REACT_APP_FIREBASE_APP_ID, + measurementId: import.meta.env.REACT_APP_FIREBASE_MEASUREMENT_ID, }; const FUNCTIONS_REGION = 'asia-northeast1'; diff --git a/src/store/state.ts b/src/store/state.ts index 417a273e..631ce660 100644 --- a/src/store/state.ts +++ b/src/store/state.ts @@ -490,7 +490,7 @@ let firebaseProvider; try { firebaseProvider = new FirebaseProvider(); } catch (cause) { - if (process.env.NODE_ENV === 'production') { + if (import.meta.env.NODE_ENV === 'production') { throw cause; } else { console.warn( diff --git a/src/utils/GoogleAnalytics.ts b/src/utils/GoogleAnalytics.ts index 4da20bd5..79ea9397 100644 --- a/src/utils/GoogleAnalytics.ts +++ b/src/utils/GoogleAnalytics.ts @@ -48,7 +48,7 @@ let analytics: firebase.analytics.Analytics | null; try { analytics = firebase.analytics(); } catch (cause) { - if (process.env.NODE_ENV === 'production') { + if (import.meta.env.NODE_ENV === 'production') { throw cause; } else { analytics = null;