diff --git a/extensions/data-workspace/src/common/utils.ts b/extensions/data-workspace/src/common/utils.ts index 7200b07baf..d78361e6a3 100644 --- a/extensions/data-workspace/src/common/utils.ts +++ b/extensions/data-workspace/src/common/utils.ts @@ -54,6 +54,10 @@ export function getPackageInfo(packageJson: any): IPackageInfo | undefined { let azdataApi: typeof azdataType | undefined = undefined; try { azdataApi = require('azdata'); + if (!azdataApi?.version) { + // webpacking makes the require return an empty object instead of throwing an error so make sure we clear the var + azdataApi = undefined; + } } catch { // no-op } diff --git a/extensions/sql-database-projects/src/common/utils.ts b/extensions/sql-database-projects/src/common/utils.ts index c2ae4f2560..44c63391d6 100644 --- a/extensions/sql-database-projects/src/common/utils.ts +++ b/extensions/sql-database-projects/src/common/utils.ts @@ -367,6 +367,10 @@ export function timeConversion(duration: number): string { let azdataApi: typeof azdataType | undefined = undefined; try { azdataApi = require('azdata'); + if (!azdataApi?.version) { + // webpacking makes the require return an empty object instead of throwing an error so make sure we clear the var + azdataApi = undefined; + } } catch { // no-op }