缺少标识为QUnit的库-G Suite教育帐户 [英] Library with identifier QUnit is missing - G Suite for Education Account
问题描述
我一直在尝试使用QUnit来测试我的代码,但一直收到此错误:缺少带有标识符QUnit的库(也许它已被删除,或者您没有读取权限?)." /p>
我确定我已使用正确的密钥正确安装了它.
我的google帐户是我公司设置的G Suite教育帐户,我有两个不同的教育帐户.两个帐户彼此位于不同的组织单位中.其中之一可以毫无问题地运行QUnit,但我需要它在引发错误的帐户上工作.
我也按照以下步骤将QUnit添加到我的项目中:
-
进入图书馆并输入代码"MxL38OxqIK-B73jyDTvCe-OBao7QLBR4j"
-
选定的版本4.
-
发布为Web应用程序,然后选择测试Web应用程序的最新代码".查看结果.
-
然后在新选项卡上显示错误消息.
当我在个人Google帐户"上尝试同样的步骤时,似乎也没有问题.
下面是我的QUnit代码,如果您可以看到我出了问题的地方,或者您应该知道应该更改的任何G Suite设置,那么这将是一个很大的帮助.
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
文件都应作为单独的文件包含在您的项目中.解决的其他方法包括删除呼叫脚本项目并在新项目中重新添加每个库的各种版本.在库开发人员方面,它包括保存该库的新版本.
可能的原因:
-
可能是随机/未知
-
使用仅查看"共享库权限
-
删除调用脚本/Webapp的旧版本
-
删除旧版本的库
-
从dev更改为固定版本的库:
-
库不同步?
可能的解决方案:
-
确定的解决方案:直接从库源代码中复制并粘贴所有依赖项,而完全不依赖于错误的库功能
-
与任何人共享脚本
- OAuth2 for Apps脚本:登录后动态更改Google Apps脚本回调 @AmitAgarwal
-
库方面:创建一个新版本;调用脚本端:逐一删除和读取库:
- 标识符为LabelServices的库丢失了(也许它被删除了?)/出了点问题.请重新加载 @theworldismyoyster
-
复制调用脚本项目并重命名库
- https://stackoverflow.com/a/32939032/ @SoftwareTester
-
在绑定脚本中,共享表格+脚本
- https://stackoverflow.com/a/61484114/ @Beyonder
-
删除调用项目并创建新项目和读取的库:
- https://stackoverflow.com/a/51587824/ @BruceKozuma
-
同时复制调用脚本和被调用库以及已读取的库引用
- https://stackoverflow.com/a/47026231 @Kwynn Buess
-
具有编辑权限的共享库:
当前未解决的问题跟踪器:
封闭式跟踪器(用于研究):
相关:
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.
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.
I took the following steps too add QUnit to my project:
Went onto Libraries and entered the code "MxL38OxqIK-B73jyDTvCe-OBao7QLBR4j"
Selected version 4.
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.
When I try these same steps on my Personal Google Account as well there seems to be no issues.
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!');
});
}
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.
Possible Cause(s):
Probably random/unknown
Sharing libraries with "view only" permissions
Deleting older version(s) of the calling script/Webapp
Deleting older version of library
Changing from dev to fixed version of library:
Libraries out of sync?
Possible Solution(s):
Sure Fix: Copy paste all dependencies directly from library source and not depend on buggy library feature at all
Share script with Anyone
Library side: Create a new version; Calling script side: Remove and readd libraries one by one:
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:
Currently Open Issue Trackers:
Closed Trackers(for research):
Related:
这篇关于缺少标识为QUnit的库-G Suite教育帐户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!