From 12e37e3dd21113588f15b2690aafb715a13ffc87 Mon Sep 17 00:00:00 2001 From: David Luzar Date: Mon, 31 Jul 2023 15:29:24 +0200 Subject: [PATCH] fix: forgotten REACT_APP env variables (#6834) --- .env.production | 4 ++-- package.json | 4 ++-- src/excalidraw-app/sentry.ts | 5 ++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.env.production b/.env.production index e3ece6df..b0570f2a 100644 --- a/.env.production +++ b/.env.production @@ -1,5 +1,5 @@ -REACT_APP_BACKEND_V2_GET_URL=https://json.excalidraw.com/api/v2/ -REACT_APP_BACKEND_V2_POST_URL=https://json.excalidraw.com/api/v2/post/ +VITE_APP_BACKEND_V2_GET_URL=https://json.excalidraw.com/api/v2/ +VITE_APP_BACKEND_V2_POST_URL=https://json.excalidraw.com/api/v2/post/ VITE_APP_LIBRARY_URL=https://libraries.excalidraw.com VITE_APP_LIBRARY_BACKEND=https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries diff --git a/package.json b/package.json index 3880ffce..66b1a777 100644 --- a/package.json +++ b/package.json @@ -101,8 +101,8 @@ "private": true, "scripts": { "build-node": "node ./scripts/build-node.js", - "build:app:docker": "cross-env REACT_APP_DISABLE_SENTRY=true REACT_APP_DISABLE_TRACKING=true vite build", - "build:app": "cross-env REACT_APP_GIT_SHA=$VERCEL_GIT_COMMIT_SHA vite build", + "build:app:docker": "cross-env VITE_APP_DISABLE_SENTRY=true VITE_APP_DISABLE_TRACKING=true vite build", + "build:app": "cross-env VITE_APP_GIT_SHA=$VERCEL_GIT_COMMIT_SHA vite build", "build:version": "node ./scripts/build-version.js", "build": "yarn build:app && yarn build:version", "fix:code": "yarn test:code --fix", diff --git a/src/excalidraw-app/sentry.ts b/src/excalidraw-app/sentry.ts index 6ad0d49f..d224a266 100644 --- a/src/excalidraw-app/sentry.ts +++ b/src/excalidraw-app/sentry.ts @@ -6,12 +6,11 @@ const SentryEnvHostnameMap: { [key: string]: string } = { "vercel.app": "staging", }; -const REACT_APP_DISABLE_SENTRY = - import.meta.env.VITE_APP_DISABLE_SENTRY === "true"; +const SENTRY_DISABLED = import.meta.env.VITE_APP_DISABLE_SENTRY === "true"; // Disable Sentry locally or inside the Docker to avoid noise/respect privacy const onlineEnv = - !REACT_APP_DISABLE_SENTRY && + !SENTRY_DISABLED && Object.keys(SentryEnvHostnameMap).find( (item) => window.location.hostname.indexOf(item) >= 0, );