【问题标题】:Why does "ReferenceError: Drive is not defined" keep occuring frequently?为什么经常出现“ReferenceError: Drive is not defined”?
【发布时间】:2020-08-10 21:33:10
【问题描述】:

const file = Drive.Files.insert({ title: 'Temp.pdf' }, blob, { ocr: true, ocrLanguage: "en" });

我已从 Resources->Advanced Google Services 启用 Drive API(v2),并在 Google Cloud Platform API Dashboard 中为该特定项目启用 Drive API。 p>

但这看起来不像一次性活动。 ReferenceError: Drive is not defined 不时出现错误。当我从 Resources->Advanced Google Services 启用 Drive API 时,一段时间没有错误,一段时间后又出现。 Resources->Advanced Google Services 中的设置未保留。

为什么不持久化?我在这里遗漏了什么吗?

【问题讨论】:

  • 这能回答你的问题吗? ReferenceError: "Drive" is not defined
  • 没有。我已经试过了。问题是我需要继续做那个设置。它没有持久化。
  • 你去https://console.cloud.google.com启用图书馆了吗?
  • 是的。我已经做到了。
  • 你好@Ekalavya!为了防止任何项目配置错误,您可以创建一个空白的新脚本并将您的代码行复制到那里吗?

标签: google-apps-script google-sheets google-drive-api google-apps-script-addon google-apps-script-api


【解决方案1】:

发现只有在我执行扣环推送后才会发生引用错误。已解决。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-12-29
    • 2018-01-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多