{"record":{"id":"3ea79d276b4436e7","repo":"toeverything/AFFiNE","slug":"missing-dependency-stringifyidentifier-target","errorCode":null,"errorMessage":"Missing dependency ${stringifyIdentifier(target)} in creating ${stringifyIdentifier(from)}.\\n${stringifyDependencyStack(dependencyStack)}","messagePattern":"Missing dependency (.+?) in creating (.+?)\\.\\\\n(.+?)","errorType":"exception","errorClass":"MissingDependencyError","httpStatus":null,"severity":"error","filePath":"packages/common/infra/src/framework/core/provider.ts","lineNumber":192,"sourceCode":"        });\n      }\n\n      if (optional) {\n        return undefined;\n      }\n      throw new ComponentNotFoundError(identifier);\n    }\n\n    const runFactory = () => {\n      const nextResolver = this.track(identifier);\n      try {\n        return withContext(() => factory(nextResolver), {\n          provider: this.provider,\n          props,\n        });\n      } catch (err) {\n        if (err instanceof ComponentNotFoundError) {\n          throw new MissingDependencyError(\n            identifier,\n            err.identifier,\n            this.stack\n          );\n        }\n        throw err;\n      }\n    };\n\n    if (noCache) {\n      return runFactory();\n    }\n\n    return this.provider.cache.getOrInsert(identifier, runFactory);\n  }\n\n  getAllRaw(\n    identifier: IdentifierValue,","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/packages/common/infra/src/framework/core/provider.ts#L174-L210","documentation":"runFactory catches a ComponentNotFoundError raised inside a factory and rethrows it as MissingDependencyError naming both the requested and missing identifier plus the dependency stack, turning raw lookup failures into diagnosable wiring errors.","triggerScenarios":"Thrown at packages/common/infra/src/framework/core/provider.ts:192 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Register a provider for the missing dependency named in the message.","Follow the printed dependency stack to find which component declares the missing dependency.","Add the module that provides the dependency to the framework setup."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b4c8548c09da21b2898443559a5b846f0ccf5dd8","analyzedAt":"2026-08-18T21:16:52.546Z","contentChangedAt":"2026-08-18T21:16:52.546Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}