【问题标题】:Server error: local network layer GraphQL failure errors服务器错误:本地网络层 GraphQL 失败错误
【发布时间】:2016-09-29 18:50:59
【问题描述】:

以前有人见过这个错误吗?我正在开发我的第一个 NodeJS / React / GraphQL 项目。这让我有点发疯。我搜索过谷歌,但似乎没有其他人以前遇到过这个问题。

  error: Server error: local network layer GraphQL failure errors=[], _settled=true, _resolve=function (value) {
  [1]     if (done) return;
  [1]     done = true;
  [1]     resolve(promise, value);
  [1]   }, _reject=function (reason) {
  [1]     if (done) return;
  [1]     done = true;
  [1]     reject(promise, reason);
  [1]   }, _45=2, _81=2, , _54=null, text=query Routes {
  [1]   Viewer {
  [1]     id,
  [1]     ...F3
  [1]   }
  [1] }
  [1] fragment F0 on Viewer {
  [1]   User_IsAnonymous,
  [1]   User_DisplayName,
  [1]   User_ProfilePhoto,
  [1]   id
  [1] }
  [1] fragment F1 on Viewer {
  [1]   User_IsAnonymous,
  [1]   id
  [1] }
  [1] fragment F2 on Viewer {
  [1]   id,
  [1]   ...F1
  [1] }
  [1] fragment F3 on Viewer {
  [1]   User_IsAnonymous,
  [1]   User_AuthToken,
  [1]   id,
  [1]   ...F0,
  [1]   ...F2,
  [1]   ...F1
  [1] }, , children=[fieldName=id, kind=Field, isGenerated=true, isRequisite=true, type=ID, , children=[fieldName=User_IsAnonymous, kind=Field, , type=Boolean, fieldName=User_AuthToken, kind=Field, , type=String, fieldName=id, kind=Field, isGenerated=true, isRequisite=true, type=ID, , children=[fieldName=User_IsAnonymous, kind=Field, , type=Boolean, fieldName=User_DisplayName, kind=Field, , type=String, fieldName=User_ProfilePhoto, kind=Field, , type=String, fieldName=id, kind=Field, isGenerated=true, isRequisite=true, type=ID], id=1::client, kind=Fragment, , name=AppBar_Auth_ViewerRelayQL, type=Viewer, $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"], name=$$_aggregated-$$_route[1]_@@default_Viewer-$$_route[2]_@@default_Viewer, , __calls__=null, __children__=[$ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["children"][0], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__route__"], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__variables__"], __calls__=[], __children__=[], __fieldMap__=null, __hasDeferredDescendant__=false, __hasValidatedConnectionCalls__=null, __serializationKey__=null, __storageKey__=null, __debugName__=undefined, __isRefQueryDependency__=false, __rangeBehaviorKey__=undefined, __shallowHash__=undefined, $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["children"][1], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__route__"], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__variables__"], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__children__"][0]["__calls__"], __children__=[], __fieldMap__=null, __hasDeferredDescendant__=false, __hasValidatedConnectionCalls__=null, __serializationKey__=null, __storageKey__=null, __debugName__=undefined, __isRefQueryDependency__=false, __rangeBehaviorKey__=undefined, __shallowHash__=undefined, $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["children"][2], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__route__"], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__variables__"], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__children__"][0]["__calls__"], __children__=[], __fieldMap__=null, __hasDeferredDescendant__=false, __hasValidatedConnectionCalls__=null, __serializationKey__=null, __storageKey__=null, __debugName__=undefined, __isRefQueryDependency__=false, __rangeBehaviorKey__=undefined, __shallowHash__=undefined, $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["children"][3], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__route__"], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__variables__"], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__children__"][0]["__calls__"], __children__=[], __fieldMap__=null, __hasDeferredDescendant__=false, __hasValidatedConnectionCalls__=null, __serializationKey__=null, __storageKey__=null, __debugName__=undefined, __isRefQueryDependency__=false, __rangeBehaviorKey__=undefined, __shallowHash__=undefined], __fieldMap__=null, __hasDeferredDescendant__=false, __hasValidatedConnectionCalls__=null, __serializationKey__=null, __storageKey__=null, __compositeHash__=_1::client1hz3YB, isDeferred=false, isContainerFragment=true, __cacheKey__=$$_aggregated-$$_route[1]_@@default_Viewer-$$_route[2]_@@default_Viewer:{}:{isContainerFragment:true,isDeferred:false}, _fragmentGetter=function () {
  [1]       return buildContainerFragment(containerName, fragmentName, fragmentBuilder, initialVariables);
  [1]     }, _isContainerFragment=true, _isDeferred=false, _variableMapping=undefined, _prepareVariables=undefined, , children=[fieldName=id, kind=Field, isGenerated=true, isRequisite=true, type=ID, , children=[fieldName=User_IsAnonymous, kind=Field, , type=Boolean, fieldName=id, kind=Field, isGenerated=true, isRequisite=true, type=ID], id=4::client, kind=Fragment, , name=NavMenu_ViewerRelayQL, type=Viewer, $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][4]["_fragment"]["children"][1]["_fragment"], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__route__"], , __calls__=null, __children__=[$ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][4]["_fragment"]["children"][1]["_fragment"]["children"][0], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__route__"], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][4]["_fragment"]["children"][1]["_fragment"]["__cachedFragment__"]["__variables__"], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__children__"][0]["__calls__"], __children__=[], __fieldMap__=null, __hasDeferredDescendant__=false, __hasValidatedConnectionCalls__=null, __serializationKey__=null, __storageKey__=null, __debugName__=undefined, __isRefQueryDependency__=false, __rangeBehaviorKey__=undefined, __shallowHash__=undefined, $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][4]["_fragment"]["children"][1]["_fragment"]["children"][1], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__route__"], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][4]["_fragment"]["children"][1]["_fragment"]["__cachedFragment__"]["__variables__"], $ref=$["request"]["_query"]["__concreteNode__"]["children"][1]["_fragment"]["children"][3]["_fragment"]["__cachedFragment__"]["__children__"][0]["__calls__"], __children__=[], __fieldMap__=null, __hasDeferredDescendant__=false, __hasValidatedConnectionCalls__=null, __serializationKey__=null, __storageKey__=null, __debugName__=undefined, __isRefQueryDependency__=false, __rangeBehaviorKey__=undefined, __shallowHash__=undefined], __fieldMap__=null, __hasDeferredDescendant__=false, __hasValidatedConnectionCalls__=null, __serializationKey__=null, __storageKey__=null, __compositeHash__=_4::client3dbVxF, isDeferred=false, isContainerFragment=true, __cacheKey__=$$_aggregated-$$_route[1]_@@default_Viewer-$$_route[2]_@@default_Viewer:{}:{isContainerFragment:true,isDeferred:false}, _fragmentGetter=function () {
  [1]       return buildContainerFragment(containerName, fragmentName, fragmentBuilder, initialVariables);
  [1]     }, _isContainerFragment=true, _isDeferred=false, _variableMapping=undefined, _
  [1] /Users/lorm/projects/React-Relay-Boilerplate/node_modules/promise/lib/done.js:10
  [1]       throw err;
  [1]       ^
  [1] 
  [1] Error: Can't set headers after they are sent.
  [1]     at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:346:11)
  [1]     at ServerResponse.header (/Users/lorm/projects/React-Relay-Boilerplate/node_modules/express/lib/response.js:718:10)
  [1]     at ServerResponse.send (/Users/lorm/projects/React-Relay-Boilerplate/node_modules/express/lib/response.js:163:12)
  [1]     at serveFailure (renderOnServer.js:28:21)
  [1]     at NetworkLayer.onError [as _onError] (renderOnServer.js:58:41)
  [1]     at NetworkLayer._executeRequest$ (/Users/lorm/projects/React-Relay-Boilerplate/node_modules/relay-local-schema/lib/NetworkLayer.js:71:18)
  [1]     at tryCatch (/Users/lorm/projects/React-Relay-Boilerplate/node_modules/relay-local-schema/node_modules/babel-runtime/regenerator/runtime.js:72:40)
  [1]     at GeneratorFunctionPrototype.invoke [as _invoke] (/Users/lorm/projects/React-Relay-Boilerplate/node_modules/relay-local-schema/node_modules/babel-runtime/regenerator/runtime.js:334:22)
  [1]     at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Users/lorm/projects/React-Relay-Boilerplate/node_modules/relay-local-schema/node_modules/babel-runtime/regenerator/runtime.js:105:21)
  [1]     at tryCatch (/Users/lorm/projects/React-Relay-Boilerplate/node_modules/relay-local-schema/node_modules/babel-runtime/regenerator/runtime.js:72:40)

【问题讨论】:

  • 好的,这似乎来自类型错误。我们用的是Universal React Boilerplate,撕掉了Cassandra的代码,以为可以用node-uuid代替Cassandra.uuid,但是前者返回的是字符串,后者返回的是对象。
  • 您应该添加相关代码,您认为可能需要对错误“错误:发送后无法设置标头。”。
  • Ahmad Ferdous Bin Alam,“无法设置标题”错误主要是早期错误开始输出这一事实的副作用。为了完整起见,我将其包括在内,但我认为我们都可以忽略它。

标签: node.js graphql


【解决方案1】:

好的,这似乎来自类型错误。我们用的是Universal React Boilerplate,撕掉了Cassandra的代码,以为可以用node-uuid代替Cassandra.uuid,但是前者返回的是字符串,后者返回的是对象。

【讨论】:

    猜你喜欢
    • 2022-07-05
    • 1970-01-01
    • 2017-12-27
    • 2017-02-02
    • 1970-01-01
    • 1970-01-01
    • 2018-01-09
    • 1970-01-01
    相关资源
    最近更新 更多