sciactive / pnotify

Beautiful JavaScript notifications with Web Notifications support.
https://sciactive.com/pnotify/
Apache License 2.0
3.65k stars 514 forks source link

PNotify 4, NPM & webpack #371

Open C0kkie opened 4 years ago

C0kkie commented 4 years ago

Hello,

i installed pnotify via

npm install --save pnotify npm install --save material-design-icons npm install --save nonblockjs

and added

window.PNotify = require("pnotify/dist/iife/PNotify");

to the app.js

if i build the things now with webpack and i use

PNotify.error({ title: 'Fehler', text: "test", styling: 'bootstrap3' });

i get the error

Uncaught TypeError: PNotify.error is not a function

M-BenAli commented 4 years ago

I had the same issue and resolved it by importing PNotify from the umd folder instead of the iife folder. Add this require statement: window.PNotify = require('pnotify/dist/umd/PNotify')