nextjs-google-adsense
nextjs-google-adsense copied to clipboard
Uncaught errors and empty page when loading additional content in JS with Ad Slots on the same page
Hello I've integrated your module and it works fine until I tried to lazy load some blocks on my app, adding blocks with ResponsiveAdUnit loaded in ReactJS I've got the following errors :
"Uncaught TagError: adsbygoogle.push() error: All ins elements in the DOM with class=adsbygoogle already have ads in them." error
I think it's due to the init of the library
I've found this that is exactly the same : https://stackoverflow.com/questions/74577652/how-to-solve-uncaught-tagerror-adsbygoogle-push-error-all-ins-elements-in-t
someone is suggesting but it did not worked for me in the main app js
if (adsbygoogle && !adsbygoogle.loaded) (adsbygoogle = (window as any).adsbygoogle || []).push({});