I finally found out what was the problem.
I was loading the Paypal SDK using a plugin as follows :
import { loadScript } from "@paypal/paypal-js";
export default defineNuxtPlugin(async () => {
const paypal = await loadScript({
"client-id":
"id",
currency: "USD",
intent: "capture",
});
return {
provide: {
paypal,
},
};
});
and also via the useHead component as follows:
useHead({
script: [
{
"data-sdk-integration-source": "developer-studio",
src: "https://www.paypal.com/sdk/js?client-id=idS¤cy=USD",
},
]
})
Somehow this generates an error when Googlebot tries to index the pages and the error causes the Nuxt client-side code to show the 404 page.
As a solution, I just removed the plugin and kept just the useHead link.