Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypeScript complains: Cannot find name 'Notification'

I am using VS 2017 and TS 2.2.1

I am getting compilation error: Cannot find name 'Notification'.

When I try to declare the Notification, TS complains that it is already declared in packages\Microsoft.TypeScript.MSBuild.2.2.1\tools\tsc. Indeed, it is there defined as:

declare var Notification: {
    prototype: Notification;
    new(title: string, options?: NotificationOptions): Notification;
    requestPermission(callback?: NotificationPermissionCallback): Promise<string>;
}
like image 256
user3284063 Avatar asked Mar 16 '17 15:03

user3284063


1 Answers

I solved the problem by upgrading TypeScript from 1.7.5 to 3.4.3

like image 127
KiwenLau Avatar answered Sep 25 '22 17:09

KiwenLau