diff --git a/src/core/initializers/index.ts b/src/core/initializers/index.ts index 993ba5d32..d9dd2a734 100644 --- a/src/core/initializers/index.ts +++ b/src/core/initializers/index.ts @@ -21,7 +21,17 @@ import { APP_INITIALIZER, Provider } from '@angular/core'; * @returns List of providers. */ export function getInitializerProviders(): Provider[] { - const context = require.context('./', false, /\.ts$/); + if (!import.meta.webpackContext) { + return []; + } + + const context = import.meta.webpackContext( + './', + { + recursive: false, + regExp: /\.\/.*\.ts$/, + }, + ); return context.keys().reduce((providers, fileName) => { const name = (fileName.match(/^(?:\.\/)?(.+)\.ts$/) || [])[1]; diff --git a/src/core/services/storage.ts b/src/core/services/storage.ts index 90e607fa3..25066f221 100644 --- a/src/core/services/storage.ts +++ b/src/core/services/storage.ts @@ -48,7 +48,7 @@ export class CoreStorageService { async initializeDatabase(): Promise { try { await CoreApp.createTablesFromSchema(APP_SCHEMA); - } catch (e) { + } catch { // Ignore errors. }