stefanobartoletti / nuxt-social-share

Simple Social Sharing for Nuxt 3
https://stefanobartoletti.github.io/nuxt-social-share/
MIT License
106 stars 8 forks source link

Fix `useRequestUrl` returning `localhost` on production environment #177

Open stefanobartoletti opened 1 month ago

stefanobartoletti commented 1 month ago

Using useRequestUrl composable is returning localhost on some production environments.

According to the docs here https://nuxt.com/docs/api/composables/use-request-url it is a known behavior, caused by Nitro caching features.

Currently, this is happening regardless of the hosting platform, i.e. both the playground of this module here, hosted on GitHub Pages:

and a live website here, on Netlify:

If possible, some configuration to be placed here in the module is desirable, to avoid setting this up in every project that uses the module.

Some help and clarifications have been asked here https://github.com/nuxt/nuxt/discussions/27393

letoast commented 1 week ago

The facebook issue https://github.com/stefanobartoletti/nuxt-social-share/issues/175 seems to be more than just localhost being provided by in the URL. You can see here that the URL is actually correct, but the facebook share still doesn't work correctly. The other platforms seem to work. image

image

It seems like this is the issue https://developers.facebook.com/community/threads/1037356734639128/

stefanobartoletti commented 1 week ago

Thanks for reporting, apparently it is a problem on Facebook side, either they changed the behavior of the share URL or some bug prevents it working correctly. Besides trying to stay updated about this, there is not much I can do on the module at the moment I fear.