Skip to content

Typings error TS2403: Subsequent variable declarations must have the same type. #890

@kspearrin

Description

@kspearrin

Upgraded to Angular 7 w/ TypeScript 3.2.4 and am now getting the following whenever I compile:

import swal from 'sweetalert';

swal({ ... });

ERROR in node_modules/sweetalert/typings/sweetalert.d.ts(4,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'swal' must be of type 'typeof import("C:/Projects/me/browser/node_modules/sweetalert/typings/sweetalert")', but here has type 'SweetAlert'.

If I edit node_modules/sweetalert/typings/sweetalert.d.ts from...

import swal, { SweetAlert } from "./core";

declare global {
  const swal: SweetAlert;
  const sweetAlert: SweetAlert;
}

export default swal;
export as namespace swal;

... to ...

import swal, { SweetAlert } from "./core";

export default swal;
export as namespace swal;

... it starts working.

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions