{"record":{"id":"7c405bc217b74eed","repo":"facebook/relay","slug":"liveresolvercache-serverweak-normalization-info","errorCode":null,"errorMessage":"LiveResolverCache: `ServerWeak` normalization info must not be normalized; it is read in place off the transplanted record.","messagePattern":"LiveResolverCache: `ServerWeak` normalization info must not be normalized; it is read in place off the transplanted record\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/relay-runtime/store/live-resolvers/LiveResolverCache.js","lineNumber":877,"sourceCode":"        // inner model instance: the model's field resolvers are wired via\n        // `resolverDataInjector(..., '__relay_model_instance', ...)`, which reads\n        // `MODEL_PROPERTY_NAME` and passes it to the resolver as the model — so\n        // storing the wrapper would make every field resolve to `undefined`.\n        const record = RelayModernRecord.create(outputTypeDataID, typename);\n\n        const modelValue =\n          MODEL_PROPERTY_NAME in value ? value[MODEL_PROPERTY_NAME] : value;\n        RelayModernRecord.setValue(record, MODEL_PROPERTY_NAME, modelValue);\n\n        source.set(outputTypeDataID, record);\n        return source;\n      }\n      case 'ServerWeak': {\n        // A read-in-place shadow server-value arm is never normalized:\n        // `_setResolverValue` short-circuits before reaching here, because the\n        // value is already normalized once by the magic-fragment transplant.\n        // Reaching this case would mean that guard was bypassed.\n        throw new Error(\n          'LiveResolverCache: `ServerWeak` normalization info must not be ' +\n            'normalized; it is read in place off the transplanted record.',\n        );\n      }\n      default:\n        normalizationInfo.kind as empty;\n        invariant(\n          false,\n          'LiveResolverCache: Unexpected normalization info kind `%s`.',\n          normalizationInfo.kind,\n        );\n    }\n  }\n\n  // If a given record does not exist, creates an empty record consisting of\n  // just an `id` field, along with a namespaced `__id` field and insert it into\n  // the store.\n  ensureClientRecord(id: string, typeName: string): DataID {","sourceCodeStart":859,"sourceCodeEnd":895,"githubUrl":"https://github.com/facebook/relay/blob/668b1b85e06261aa3b58dabfc51f8b5524a70955/packages/relay-runtime/store/live-resolvers/LiveResolverCache.js#L859-L895","documentation":"In LiveResolverCache's normalization switch, the 'ServerWeak' case is unreachable by design: ServerWeak values are read in place from a transplanted record and are short-circuited by _setResolverValue before normalization. Reaching this throw indicates an internal invariant was violated, not a user error.","triggerScenarios":"An internal bug or version mismatch bypassing the _setResolverValue short-circuit so a ServerWeak resolver value reaches getNormalized resolver code — e.g. mixing relay-runtime versions of live-resolver internals, or custom cache subclasses routing values through normalization directly.","commonSituations":"Mismatched relay/react-relay package versions where LiveResolverCache internals disagree; monkey-patching or subclassing LiveResolverCache; a genuine Relay bug after upgrading.","solutions":["Align all relay-related package versions (react-relay, relay-runtime, relay-test-utils) to the same release","Remove custom subclasses/patches around LiveResolverCache and use the public API","Report with a reproduction to facebook/relay if it occurs on a single consistent version — this is an internal invariant failure","As a workaround, disable experimental live resolvers to avoid the code path"],"exampleFix":"// before\n\"relay-runtime\": \"13.2.0\",\n\"react-relay\": \"14.1.0\" // mismatched internals\n// after\n\"relay-runtime\": \"14.1.0\",\n\"react-relay\": \"14.1.0\"","handlingStrategy":"try-catch","validationCode":"null","typeGuard":"null","tryCatchPattern":"try {\n  readViaLiveResolverCache();\n} catch (e) {\n  if (String(e.message).includes('ServerWeak')) {\n    console.error('Internal LiveResolverCache invariant violated; check relay package version alignment');\n  } else throw e;\n}","preventionTips":["Keep relay-runtime and react-relay on identical versions","Don't subclass or patch LiveResolverCache internals","Avoid experimental live resolver paths unless needed","Reproduce and report invariant failures upstream"],"tags":["relay","live-resolvers","internal-invariant","cache"],"backgroundTag":"invariant-violation","analyzedSha":"668b1b85e06261aa3b58dabfc51f8b5524a70955","analyzedAt":"2026-09-02T19:57:20.783Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}