mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
fix: make firebase config parsing not fail on undefined env (#4381)
This commit is contained in:
parent
6e391728fe
commit
ed8fb40b63
1 changed files with 9 additions and 1 deletions
|
@ -11,7 +11,15 @@ import { MIME_TYPES } from "../../constants";
|
||||||
// private
|
// private
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
const FIREBASE_CONFIG = JSON.parse(process.env.REACT_APP_FIREBASE_CONFIG);
|
let FIREBASE_CONFIG: Record<string, any>;
|
||||||
|
try {
|
||||||
|
FIREBASE_CONFIG = JSON.parse(process.env.REACT_APP_FIREBASE_CONFIG);
|
||||||
|
} catch (error: any) {
|
||||||
|
console.warn(
|
||||||
|
`Error JSON parsing firebase config. Supplied value: ${process.env.REACT_APP_FIREBASE_CONFIG}`,
|
||||||
|
);
|
||||||
|
FIREBASE_CONFIG = {};
|
||||||
|
}
|
||||||
|
|
||||||
let firebasePromise: Promise<typeof import("firebase/app").default> | null =
|
let firebasePromise: Promise<typeof import("firebase/app").default> | null =
|
||||||
null;
|
null;
|
||||||
|
|
Loading…
Add table
Reference in a new issue