From 0db22474e4fe0565b506b5f48b516ef2e39ae157 Mon Sep 17 00:00:00 2001 From: Arpit Saxena Date: Sat, 2 Nov 2024 01:29:04 -0400 Subject: [PATCH] added sourcemaps to build to debug issues; attempted fix to Cannot read properties of null (reading 'toLowerCase') --- apps/src/metabase/helpers/getDatabaseSchema.ts | 4 ++-- web/vite.config.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/src/metabase/helpers/getDatabaseSchema.ts b/apps/src/metabase/helpers/getDatabaseSchema.ts index 2572468..23f6814 100644 --- a/apps/src/metabase/helpers/getDatabaseSchema.ts +++ b/apps/src/metabase/helpers/getDatabaseSchema.ts @@ -151,7 +151,7 @@ export async function logMetabaseVersion() { } function getTableKey(tableInfo: T): string { - return `${tableInfo.schema.toLowerCase()}.${tableInfo.name.toLowerCase()}`; + return `${tableInfo.schema?.toLowerCase()}.${tableInfo.name.toLowerCase()}`; } function dedupeTables(tables: T[]): T[] { @@ -161,7 +161,7 @@ function dedupeTables(tables: T[]): T[] { function lowerAndDefaultSchemaAndDedupe(tables: TableAndSchema[]): TableAndSchema[] { let lowered = tables.map(tableInfo => ({ name: tableInfo.name.toLowerCase(), - schema: tableInfo.schema.toLowerCase() || 'public' + schema: tableInfo.schema?.toLowerCase() || 'public' })); return dedupeTables(lowered); } diff --git a/web/vite.config.ts b/web/vite.config.ts index bbc6f5e..60b0d7b 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -31,6 +31,7 @@ export default ({ mode }) => { build: { outDir: path.resolve(__dirname, './web-build'), emptyOutDir: true, + sourcemap: true, }, root: path.resolve(__dirname, 'src/app'), // Set the root to your app directory publicDir: path.resolve(__dirname, 'public'), // Set the public directory to your public directory