diff --git a/packages/backend/src/managers/catalogManager.ts b/packages/backend/src/managers/catalogManager.ts index 565b3df1a..db1e390bd 100644 --- a/packages/backend/src/managers/catalogManager.ts +++ b/packages/backend/src/managers/catalogManager.ts @@ -59,9 +59,6 @@ export class CatalogManager { async loadCatalog() { const catalogPath = path.resolve(this.appUserDirectory, 'catalog.json'); - if (!existsSync(catalogPath)) { - return this.setCatalog(defaultCatalog); - } try { this.watchCatalogFile(catalogPath); // do not await, we want to do this async @@ -69,6 +66,10 @@ export class CatalogManager { console.error(`unable to watch catalog file, changes to the catalog file won't be reflected to the UI`, err); } + if (!existsSync(catalogPath)) { + return this.setCatalog(defaultCatalog); + } + try { const cat = await this.readAndAnalyzeCatalog(catalogPath); return this.setCatalog(cat);