Skip to content

Commit

Permalink
added sourcemaps to build to debug issues; attempted fix to Cannot re…
Browse files Browse the repository at this point in the history
…ad properties of null (reading 'toLowerCase')
  • Loading branch information
kektobiologist committed Nov 2, 2024
1 parent 941a6bf commit 0db2247
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/src/metabase/helpers/getDatabaseSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export async function logMetabaseVersion() {
}

function getTableKey<T extends TableAndSchema>(tableInfo: T): string {
return `${tableInfo.schema.toLowerCase()}.${tableInfo.name.toLowerCase()}`;
return `${tableInfo.schema?.toLowerCase()}.${tableInfo.name.toLowerCase()}`;
}

function dedupeTables<T extends TableAndSchema>(tables: T[]): T[] {
Expand All @@ -161,7 +161,7 @@ function dedupeTables<T extends TableAndSchema>(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);
}
Expand Down
1 change: 1 addition & 0 deletions web/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0db2247

Please sign in to comment.