sciactive / pnotify

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

Cannot read property 'body' of undefined #259

Closed 100cm closed 6 years ago

100cm commented 8 years ago

when i use webpack and common JS ; require("pnotify");and load the page;

its occurred an error;

Cannot read property 'body' of undefined;

i even not use the new PNotify constructor , how to fix this problem??

ali32b commented 7 years ago

I had the same problem.just use imports-loader and add this: var PNotify=require('imports?global=>window,this=>window!pnotify'); But this doesn't solve problem with pnotify.buttons.js

twig commented 7 years ago

You'll need to modify your webpack configuration.

There's a fix here: https://github.com/sciactive/pnotify/issues/212#issuecomment-177952188

hperrin commented 6 years ago

This should be fixed now. You can reopen if it isn't.