首页 > 解决方案 > 资源已使用链接预加载进行预加载,但在窗口加载事件后的几秒钟内未使用 - Wix 提取错误

问题描述

我正在使用 Google Analytics API 来查询用户帐户并查看这样做,我正在使用多个 WIX 提取函数(每个提取函数取决于前一个),这里是其中之一:

export function GetGAView (access_token, account_id,webPropertyId){

const url1 = "https://www.googleapis.com/analytics/v3/management/accounts/"
const url2 = account_id
const url3 =  "/webproperties/"
const url4 =  webPropertyId
const url5 =  "/profiles?oauth_token="
const url6 = access_token


const url =url1.concat(url2,url3,url4,url5,url6).toString()
  console.log(url, 'view url')
return fetch(url, {"method": "get"})
  .then( (httpResponse) => {
    if (httpResponse.ok) {
      return httpResponse.json();
    } else {
      return Promise.reject("Fetch did not succeed");
    }
  } )
  .then(json => {//console.log(json)
  return json
    }
      )

  .catch(err => console.log(err));



}

11 个中的 4 个运行良好(由帐户 ID 和属性 ID 区分的相同函数)和 7 个函数返回控制台上显示的以下错误:

错误

/ga/oauth2callback?code=4%2XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&scope=email+openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fanalytics&authuser=0&prompt=none:1 **The resource https://static.parastorage.com/services/editor-elements/dist/componentSdks.a8951fd0.bundle.min.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.**

这个错误是什么意思?如何解决这个问题?我发现相同错误的唯一地方是 https://www.wix.com/corvid/forum/community-discussion/parastorage-link-preload-failure

标签: google-apifetchvelo

解决方案


推荐阅读