Events Plugin 📆

I have updated the plugin to the latest changes but I’m getting an odd error which the plugin seems to trigger, but it’s unclear if it’s coming from the plugin itself.

If the plugin is disabled, there are no errors. But, if it’s enabled, I start getting the error below whenever I load a topic, even if it doesn’t have any event.

Console error
rsvp.js:23 Uncaught 
TypeError: i(...)(...).magnificPopup is not a function
    at lightbox.js:55:19
    at _ (rsvp.js:434:1)
    at y (rsvp.js:420:1)
    at invoke (backburner.js.js:282:1)
    at h.flush (backburner.js.js:197:1)
    at p.flush (backburner.js.js:358:1)
    at B._end (backburner.js.js:798:1)
    at B.end (backburner.js.js:589:1)
    at B._run (backburner.js.js:842:1)
    at B.run (backburner.js.js:624:1)
    at e.run (index.js:75:1)
    at o.onload.o.onreadystatechange (load-script.js:38:9)

Although the error seems to be thrown on rsvp.js, disabling events_rsvp doesn’t seem quiet the errors – only completely disabling the plugin does. As far as I can tell, the RSVP feature itself is working.

Now, where this gets more confusing: the error seems to only come up if there’s an image on a post on that topic… But, again, the same topic has no errors if the events plugin is disabled. Something about images on posts and the discourse events plugin seems to be interacting, which is odd.

While messing around to try to understand this, I noticed that if I enable the experimental new lightbox, then the error actually goes away, I guess because Discourse no longer uses magnificPopup() but the new lightbox. This seems to indicate that the error may be on the lightbox code, but the events plugin seems to surface (and catch it) somehow? Given that the experimental new lightbox settings has been disabled on meta, I’m not clear whether it will become a permanent change.

Anyway, anyone else seeing these errors when running the latest version of the plugin? In my case I’m running Discourse’s latest stable (v3.2.2).