doublesecretagency / craft-adwizard

Ad Wizard plugin for Craft CMS
Other
7 stars 8 forks source link

Uncaught ReferenceError: adWizard is not defined #23

Closed hhhc closed 3 years ago

hhhc commented 3 years ago

Hi,

I have bought a licence and find this a nice plugin. However, when deploying to production I get the following error code

Uncaught ReferenceError: adWizard is not defined at HTMLImageElement.onclick (VM32:135)

The problem is that the click does not work anymore. So the ad is displayed but clicks dont work. See yourself: https://knxtutorial.com/ This is really bad and makes the whole module obsolete. Any ideas how to fix that? Everything works find on local machine.

EDIT: Just found out that the JS missing on PROD. The 2 lines are not added

Thanks-

lindseydiloreto commented 3 years ago

Hi @hhhc,

Sounds like you are caching (via Blitz?) the Twig tags that output the Ads. Take a look at this thread for more information...

Specifically, take a look at this comment...

Even more manual than that – I copied superagent.js and aw.js verbatim from the resources folder and pasted it into our own custom scripts.

As the quickest and easiest workaround, just copy both of those JS files into your front-end resources folder, and link to them normally. Don't worry, they are unlikely to change significantly anytime soon. 🙂

Hope that helps!