moritzsternemann / vue-plausible

Plausible Analytics Vue.js Plugin and NuxtJS Module
MIT License
121 stars 8 forks source link

Request called twice #9

Closed kernoeb closed 2 years ago

kernoeb commented 3 years ago

Hello! I'm having almost the same issue : "Request executed twice #3".

I'm using Nuxt.js too (with default SSR), except that I only use the nuxt.config.js configuration, I don't call it somewhere else :thinking:, and it's the same endpoint for both

modules: [
  'vue-plausible'
],

plausible: {
  apiHost: 'https://plausible.example.com'
},

image

Any idea ? Thanks!

moritzsternemann commented 3 years ago

Hey @kernoeb! Could you provide a minimum working example that shows the issue, please?

kernoeb commented 3 years ago

Hey @kernoeb! Could you provide a minimum working example that shows the issue, please?

Thanks for your answer :smile:

Nothing really interesting to show you, but here's my project : https://github.com/kernoeb/planningiut/blob/main/nuxt.config.js#L100

When the website is loaded, the "event" request is called twice, and I don't think that's normal

(I also use "trackEvent" but that's not related)

CalebKester commented 2 years ago

I had the same issue that I worked through today. First page would trigger a double event and then nuxt-links would correctly do one. Couldn't figure it out. I created a sandbox environment and found that it didn't happen there. I was running nuxt@2.15.3 which was causing the issue. Upgrading to nuxt@2.15.8 solved the issue for me.

moritzsternemann commented 2 years ago

Thanks for sharing how you solved this issue @CalebKester! I see @kernoeb has worked around it in the meantime. If it pops up for anyone else or somebody has hints for reproducing this, I'm happy to investigate further.