79404272

Date: 2025-02-01 01:14:06
Score: 0.5
Natty:
Report link

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&currency=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.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Yassinonce