{"record":{"id":"2077016e959011ab","repo":"remix-run/remix","slug":"cannot-install-context-property-formattedproperty-207701","errorCode":null,"errorMessage":"Cannot install context property {formattedProperty} because another context key already uses it.","messagePattern":"Cannot install context property (.+?) because another context key already uses it\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/fetch-router/src/lib/request-context.ts","lineNumber":315,"sourceCode":"    }\n\n    if (property.length === 0) {\n      throw new Error('Cannot install an empty context property name.')\n    }\n\n    let formattedProperty = JSON.stringify(property)\n\n    let existingProperty = this.#contextPropertyKeys.get(key)\n    if (existingProperty != null && existingProperty !== property) {\n      throw new Error(\n        `Cannot install context property ${formattedProperty} because this context key already uses ${JSON.stringify(existingProperty)}.`,\n      )\n    }\n\n    let existingKey = this.#contextProperties.get(property)\n    if (existingKey != null) {\n      if (existingKey !== key) {\n        throw new Error(\n          `Cannot install context property ${formattedProperty} because another context key already uses it.`,\n        )\n      }\n\n      return\n    }\n\n    if (property in this) {\n      throw new Error(\n        `Cannot install context property ${formattedProperty} because it already exists on RequestContext.`,\n      )\n    }\n\n    this.#contextProperties.set(property, key)\n    this.#contextPropertyKeys.set(key, property)\n\n    Object.defineProperty(this, property, {\n      get: () => this.get(key),","sourceCodeStart":297,"sourceCodeEnd":333,"githubUrl":"https://github.com/remix-run/remix/blob/9696913134be3a4423513d2775f7b31d6917c049/packages/fetch-router/src/lib/request-context.ts#L297-L333","documentation":"Property names on RequestContext are globally unique: two different context keys cannot install the same property name. This error fires when key B tries to use a property name already installed by a different key A.","triggerScenarios":"ctx.set(userKey, u, { property: 'user' }) in one middleware and ctx.set(authKey, a, { property: 'user' }) in another.","commonSituations":"Multiple packages or middleware independently attaching a generic name like 'user' or 'session'; merging middleware from different authors.","solutions":["Prefix property names per feature: 'authUser' vs 'currentUser'","Read the existing property via its owning key instead of installing a second one","Centralize key+property registration in one module"],"exampleFix":"// before\nctx.set(authKey, a, { property: 'user' })\nctx.set(profileKey, p, { property: 'user' })\n// after\nctx.set(authKey, a, { property: 'authUser' })\nctx.set(profileKey, p, { property: 'profileUser' })","handlingStrategy":"validation","validationCode":"const usedBy = contextProperties.get(property)\nif (usedBy != null && usedBy !== key) throw new Error('property already in use')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Namespace properties per feature ('authUser', 'profileUser')","Centralize context property registration"],"tags":["request-context","fetch-router","middleware"],"backgroundTag":"invalid-context-property","analyzedSha":"9696913134be3a4423513d2775f7b31d6917c049","analyzedAt":"2026-08-27T19:55:01.024Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}