CodeSeven / toastr

Simple javascript toast notifications
http://www.toastrjs.com
MIT License
11.9k stars 2.04k forks source link

toastr.info is not a function #668

Closed developer-pta closed 3 years ago

developer-pta commented 3 years ago

Hi I can't get toastr to work... I'm using Aurelia and typescript. With import like this: import toastr from "toastr"; I get error: app.ts:17 Uncaught (in promise) TypeError: Cannot read property 'info' of undefined.

With import like this: import * as toastr from "toastr"; I get error: Uncaught (in promise) TypeError: toastr.info is not a function

The usage pattern is: toastr.info("Test");

also tried import {default as toastr} from "toastr"; which gave me error: Uncaught (in promise) TypeError: Cannot read property 'info' of undefined.

How to get it to work properly?

developer-pta commented 3 years ago

The problem is not in toastr, but the module loader I use.