Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/427.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript IE-graphql-SCRIPT5022:不能使用未定义的;布尔值;来自另一个模块或领域_Javascript_Reactjs_Internet Explorer_Webpack_Graphql - Fatal编程技术网

Javascript IE-graphql-SCRIPT5022:不能使用未定义的;布尔值;来自另一个模块或领域

Javascript IE-graphql-SCRIPT5022:不能使用未定义的;布尔值;来自另一个模块或领域,javascript,reactjs,internet-explorer,webpack,graphql,Javascript,Reactjs,Internet Explorer,Webpack,Graphql,适用于除Internet Explorer以外的所有浏览器,其中出现以下错误 SCRIPT5022:无法使用来自其他模块或 王国。确保中只有一个“graphql”实例 节点\模块目录。如果使用不同版本的“graphql” 其他依赖模块的依赖关系,使用“解决方案”确保 只安装了一个版本。 复制品 “graphql”模块不能同时使用,因为不同的 版本可能具有不同的功能和行为。数据来自 函数中使用的一个版本与另一个版本可能会产生混淆 和虚假的结果 来自/node\u modules/graphql/m

适用于除Internet Explorer以外的所有浏览器,其中出现以下错误

SCRIPT5022:无法使用来自其他模块或 王国。确保中只有一个“graphql”实例 节点\模块目录。如果使用不同版本的“graphql” 其他依赖模块的依赖关系,使用“解决方案”确保 只安装了一个版本。 复制品 “graphql”模块不能同时使用,因为不同的 版本可能具有不同的功能和行为。数据来自 函数中使用的一个版本与另一个版本可能会产生混淆 和虚假的结果

来自
/node\u modules/graphql/module/jsutils/instanceOf.js

 if (value) {
    var valueConstructor = value.constructor;
    if (valueConstructor && valueConstructor.name === constructor.name) {
      throw new Error("Cannot use " + constructor.name + " \"" + value + "\" from another module or realm.Ensure that there is only one instance of \"graphql\" in the node_modules directory. If different versions of \"graphql\" are the dependencies of other relied on modules, use \"resolutions\" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate \"graphql\" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.");
import "babel-polyfill"

您需要添加polyfill以支持IE11。

对于使用Babel传输应用程序的任何人,您应该:

npm install --save babel-polyfill
然后导入您的
index.js

 if (value) {
    var valueConstructor = value.constructor;
    if (valueConstructor && valueConstructor.name === constructor.name) {
      throw new Error("Cannot use " + constructor.name + " \"" + value + "\" from another module or realm.Ensure that there is only one instance of \"graphql\" in the node_modules directory. If different versions of \"graphql\" are the dependencies of other relied on modules, use \"resolutions\" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate \"graphql\" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.");
import "babel-polyfill"

希望有帮助。

您解决了这个问题吗?