Skip to content

Commit

Permalink
fix: fixing variable name typo
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonNotJson committed Sep 16, 2023
1 parent ebb2a15 commit 95dc902
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/configs/amplify/build-setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { microAppCorsHeader, securityHeaders } from './website';

export const BIT_TOKEN = process.env.BIT_TOKEN!;
export const FEEDS_DEPLOY_KEY = process.env.DEPLOY_KEY!;
export const MASTER_VITE_GA_ID = process.env.VITE_GA_ID!;
export const MASTER_VITE_GA_ID = process.env.MASTER_VITE_GA_ID!;
export const DEV_VITE_GA_ID = process.env.DEV_VITE_GA_ID!;

const preBuild = {
Expand Down
12 changes: 10 additions & 2 deletions lib/constructs/presentation/web-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,17 @@ export class AmplifyMonoWebApp extends AbstractWebApp {
constructor(scope: Construct, id: string, props: WebAppProps) {
super(scope, id, props);

if (!MASTER_VITE_GA_ID || !DEV_VITE_GA_ID) {
throw new Error('Required environment variables are missing.');
const missingVars = [];

if (!MASTER_VITE_GA_ID) missingVars.push('MASTER_VITE_GA_ID');
if (!DEV_VITE_GA_ID) missingVars.push('DEV_VITE_GA_ID');

if (missingVars.length > 0) {
throw new Error(
`Required environment variables are missing: ${missingVars.join(', ')}`,
);
}

this.appProps = props;

this.app = new amplify.App(this, 'root-app', {
Expand Down

0 comments on commit 95dc902

Please sign in to comment.