diff --git a/tns-core-modules/application/application-common.ts b/tns-core-modules/application/application-common.ts index dd3a64e21..32ab9dc04 100644 --- a/tns-core-modules/application/application-common.ts +++ b/tns-core-modules/application/application-common.ts @@ -88,7 +88,12 @@ export function getCssFileName(): string { } export function loadAppCss(): void { - events.notify({ eventName: "loadAppCss", object: app, cssFile: getCssFileName() }); + try { + events.notify({ eventName: "loadAppCss", object: app, cssFile: getCssFileName() }); + } catch (e) { + throw new Error(`The file ${getCssFileName()} couldn't be loaded! ` + + `You may need to register it inside ./app/vendor.ts.`); + } } export function addCss(cssText: string): void { @@ -97,4 +102,4 @@ export function addCss(cssText: string): void { global.__onUncaughtError = function (error: NativeScriptError) { events.notify({ eventName: uncaughtErrorEvent, object: app, android: error, ios: error, error: error }); -} \ No newline at end of file +}