缺少标识符为 QUnit 的库 - G Suite 教育版帐户 [英] Library with identifier QUnit is missing - G Suite for Education Account

查看:13
本文介绍了缺少标识符为 QUnit 的库 - G Suite 教育版帐户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试使用 QUnit 来测试我的代码,但一直收到此错误:缺少标识符为 QUnit 的库(可能它已被删除,或者您可能没有读取权限?)."

I have been trying to use QUnit to test my code but have been getting this error: "Library with identifier QUnit is missing (perhaps it was deleted, or maybe you don't have read access?)."

我确定我已经使用正确的密钥正确安装了它.

I am sure I have installed it correctly with the correct key.

我的 Google 帐户是我公司设置的 G Suite 教育版帐户,我有两个不同的教育帐户.这两个帐户位于彼此不同的组织单位中.其中之一可以毫无问题地运行 QUnit,但我需要它来处理引发错误的帐户.

My google account is a G Suite for Education Account that's been set up by my company, I have two different Education accounts with them. Both accounts are in different organisational units from each other. One of them can run QUnit with no issues but I need it to work on the account that is throwing the error.

我也采取了以下步骤将 QUnit 添加到我的项目中:

I took the following steps too add QUnit to my project:

  1. 进入图书馆并输入代码MxL38OxqIK-B73jyDTvCe-OBao7QLBR4j"

  1. Went onto Libraries and entered the code "MxL38OxqIK-B73jyDTvCe-OBao7QLBR4j"

选定的版本 4.

发布为 Web 应用程序,然后选择测试 Web 应用程序以获取最新代码";查看结果.

Published as a Web App and then selected "Test web app for your latest code" to view the results.

然后我会在新选项卡上看到错误消息.

I am then presented with the error message on a new tab.

当我也在我的个人 Google 帐户上尝试这些相同的步骤时,似乎没有问题.

When I try these same steps on my Personal Google Account as well there seems to be no issues.

以下是我的 QUnit 代码,如果您能看到我出错的地方,或者您知道有任何 G Suite 设置需要更改,那将会有很大帮助.

Below is my QUnit code, if you can see where I've went wrong or if there are any G Suite Settings that should be changed that you know of that would be a great help.

function doGet( e ) {
  QUnit.urlParams( e.parameter );
  
  QUnit.config({
    title: "Unit tests for my project" 
  });
  QUnit.load( tests );
  return QUnit.getHtml();
};


function tests() {
  addEqual();
  addNotEqual();
  multiplyEqual();
  multiplyNotEqual();
}


function addEqual() {
  test("Add number to number", function() {
    equal(addNumbers(), 5, 'It worked!');
  });
}

function addNotEqual() {
  test("Add number to number", function() {
    equal(addNumbers(), 8, 'It worked!');
  });
}

function multiplyEqual() {
  test("Multiply Number with a Number", function() {
    equal(multiply(), 6, 'It Worked!');
  });
}

function multiplyNotEqual() {
  test("Multiply Number with a Number", function() {
    notEqual(multiply(), 9, 'It Worked!');
  });
}

推荐答案

总结:

目前为止,解决问题最简单的方法是根本不使用库功能,而是直接从库的源中复制粘贴文件.请注意,所有 .gs.html 文件都应作为单独的文件包含在您的项目中.其他解决方法包括删除调用脚本项目并在新项目中重新添加每个库的各种版本.在库开发者方面,它包括保存库的新版本.

Summary:

So far, the easiest way to solve the issue is not to use the library feature at all, but directly copy paste files from the library's source. Note that all .gs and .html files should be included as separate files in your project. Other ways to solve includes various versions of deleting the calling script project and re-adding each library in a new project. On the library developer side, it includes saving a new version of the library.

  • 可能是随机的/未知的

  • Probably random/unknown

使用仅查看"共享库权限

Sharing libraries with "view only" permissions

删除调用脚本/Web 应用程序的旧版本

Deleting older version(s) of the calling script/Webapp

删除旧版本的库

从库的开发版本更改为固定版本:

Changing from dev to fixed version of library:

库不同步?

  • 确定修复:直接从库源复制粘贴所有依赖项,完全不依赖有问题的库功能

  • Sure Fix: Copy paste all dependencies directly from library source and not depend on buggy library feature at all

与任何人分享脚本

  • OAuth2 for Apps Script: Google Apps Script callback is changed dynamically after login @AmitAgarwal

库端:创建新版本;调用脚本端:一一删除和读取库:

Library side: Create a new version; Calling script side: Remove and readd libraries one by one:

  • Library with identifier LabelServices is missing (perhaps it was deleted?) / Something went wrong. Please reload @theworldismyoyster

复制调用脚本项目并重命名库

Copy calling script project and rename Library

  • https://stackoverflow.com/a/32939032/ @SoftwareTester

在绑定脚本中,共享工作表+脚本

In a bound script, Share sheet+script

  • https://stackoverflow.com/a/61484114/ @Beyonder

删除调用项目并创建新项目和读取库:

Delete calling project and create new project and readd libraries:

  • https://stackoverflow.com/a/51587824/ @BruceKozuma

复制调用脚本和调用库以及读取库引用

Copy both calling script and called library and readd library references

  • https://stackoverflow.com/a/47026231 @Kwynn Buess

具有编辑权限的共享库:

Share library with edit privileges:

  • GAS Library and WebApp Permissions [ReferenceError: "service" is not defined.] @ScottS.

https://issuetracker.google.com/issues/36762341

https://issuetracker.google.com/issues/36765407

https://issuetracker.google.com/issues/36758687

https://issuetracker.google.com/issues/36760089

这篇关于缺少标识符为 QUnit 的库 - G Suite 教育版帐户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆