versions NUXT:v3.14.1592 节点:v20.10.0 生殖 https://iptvlandbox.com/ nuxt.config.js: 从“路径”导入{resolve}; 导出默认defenenuxtConfig({ 兼容日期:...

问题描述 投票:0回答:1
NUXT:v3.14.1592

节点:v20.10.0
  • 取代
https://iptvlandbox.com/

import { resolve } from "path"; export default defineNuxtConfig({ compatibilityDate: "2024-11-01", devtools: { enabled: false }, nitro: { prerender: { crawlLinks: true, }, }, alias: { "@": resolve(__dirname, "/"), }, modules: ["@pinia/nuxt"], plugins: [ "~/plugins/prescripts.js", "~/plugins/paypal.js", "~/plugins/track.js", ], pinia: { storesDirs: ["./stores/**"], }, nitro: { middleware: ["~/server/middleware/proxy"], }, vue: { compilerOptions: { isCustomElement: (tag) => tag.startsWith("ion-"), }, }, serverHandlers: [ { route: "/api", handler: "~/server/middleware/proxy.js", }, ], });

to繁殖 加载已使用

npm run build && node ./server/index.mjs
构建的繁殖URL

遵守该页面已加载的事实

    在控制台中查看网络
  1. 页页
    授予
    
  2. 期望什么?
  3. 该页面应正确加载,并由Google使用所有相关资源来索引,搜索引擎应该可以联系。
  4. 实际上发生了什么?
  5. 出于某种奇怪的原因,尽管我的URL可以被Google PagesPeed Insights访问,并且通过URL,Google难以索引页面并将其标记为软404。
  6. 当我单击错误时,我选择测试实时URL> ScreenShot的选项时,我发现返回的页面是默认的404页。无论出于何种原因,当Google试图索引页面时,获取默认的404页。
我会附上屏幕截图,我将感谢这里的一些指导或建议,谢谢👍

Google实时测试屏幕截图

实际上发生了什么?

出于某种奇怪的原因,尽管我的URL可以被Google PagesPeed Insights访问,并且通过URL,Google难以索引页面并将其标记为软404。

我终于发现了问题所在。

I使用插件加载PayPal SDK如下:

import { loadScript } from "@paypal/paypal-js"; export default defineNuxtPlugin(async () => { const paypal = await loadScript({ "client-id": "id", currency: "USD", intent: "capture", }); return { provide: { paypal, }, }; });

还通过使用headhead组件如下:

useHead({ script: [ { "data-sdk-integration-source": "developer-studio", src: "https://www.paypal.com/sdk/js?client-id=idS&currency=USD", }, ] })

当GoogleBot试图索引页面时,这会产生错误,并且错误导致NUXT客户端代码显示404页。

当解决方案时,我刚刚删除了插件并仅保留了usehead链接。

nuxt.js nuxt3.js google-search-console custom-error-pages
1个回答
0
投票
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.