-1
有沒有人看過這個錯誤?我正在處理我的第一個NodeJS/React/GraphQL項目。這讓我有點瘋狂。我搜索了Google,但以前似乎沒有人遇到過這個問題。服務器錯誤:本地網絡層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][email protected]@default_Viewer-$$_route[2][email protected]@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][email protected]@default_Viewer-$$_route[2][email protected]@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][email protected]@default_Viewer-$$_route[2][email protected]@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,但前者返回一個字符串,後者返回一個對象。 – lorm
您應該添加相關代碼,您認爲可能必須對錯誤進行一些操作:「錯誤:發送後無法設置標題」。 –
Ahmad Ferdous Bin Alam,「無法設置標題」錯誤主要是早期錯誤開始輸出的一個副作用。爲了完整起見,我將它包括在內,但我認爲我們都可以忽略它。 – lorm