mazipan / vue-google-adsense

💰 Vue.js Google Adsense Component with InFeed and InArticle Ads support
https://mazipan.github.io/vue-google-adsense/
MIT License
257 stars 42 forks source link

🐛 Bug - adsbygoogle.push() error: No slot size for availableWidth=0 #159

Open vicglarson opened 3 years ago

vicglarson commented 3 years ago

Hey. I have the same issue as described in closed https://github.com/mazipan/vue-google-adsense/issues/157

My site layout

.banner .banner-inline Adsense

I tried these styles:

theme_foxexeDark .banner { width: 320px; height: 190px; max-height: 190px; margin: 5px 5px 5px 5px; }

.banner { width: 345px; height: 230px; max-height: 230px; margin: 20px 6px 0; }

.banner-inline { width: 320px; min-width: 320px; // with and without height: 190px; min-height: 190px; // with and without }

In both cases i got the same error.

I think it's not about styling, but some race issue.

You can try start from any game on my site, i.e https://play.drova.io/games/agony-unrated

Then navigate to game list (root of site https://play.drova.io/). At first navigation error occurs.

My apologies if I am mistaken.

hsks commented 3 years ago

Facing the same issue with custom styling for ads

mazipan commented 3 years ago

Maybe wrap it inside some conditional render.

// mounted is `data` that filled set to true after mounted
<div v-if="mounted">
  AdSense here
</div>