{"record":{"id":"6e9c73f29fb87f26","repo":"toeverything/AFFiNE","slug":"frameworkstackprovider-must-have-at-least-one-prov","errorCode":null,"errorMessage":"FrameworkStackProvider must have at least one provider","messagePattern":"FrameworkStackProvider must have at least one provider","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/common/infra/src/framework/core/provider.ts","lineNumber":333,"sourceCode":"\n  dispose(): void {\n    if (this.disposed) {\n      return;\n    }\n    this.disposed = true;\n    this.cache.dispose();\n    this.eventBus.dispose();\n  }\n}\n\nexport class FrameworkStackProvider extends FrameworkProvider {\n  public readonly stack: FrameworkProvider[];\n  public readonly collection: Framework;\n  public readonly eventBus: EventBus;\n\n  constructor(providers: FrameworkProvider[]) {\n    if (providers.length === 0) {\n      throw new Error('FrameworkStackProvider must have at least one provider');\n    }\n    super();\n    this.stack = [...providers];\n\n    // use the collection and eventBus from the first provider\n    this.collection = this.stack[0].collection;\n    this.eventBus = this.stack[0].eventBus;\n  }\n\n  get scope(): FrameworkScopeStack {\n    return this.stack[0]?.scope || [];\n  }\n\n  getRaw(identifier: IdentifierValue, options?: ResolveOptions): any {\n    for (const provider of this.stack) {\n      const service = provider.getRaw(identifier, {\n        ...options,\n        optional: true,","sourceCodeStart":315,"sourceCodeEnd":351,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/packages/common/infra/src/framework/core/provider.ts#L315-L351","documentation":"A constructor validation error on FrameworkStackProvider: it fires when the class is instantiated with an empty providers array. FrameworkStackProvider delegates its collection and eventBus to the first provider in the stack, so at least one provider is structurally required; the faulting input is the empty providers array passed to the constructor.","triggerScenarios":"Thrown at packages/common/infra/src/framework/core/provider.ts:333 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass at least one provider when constructing the FrameworkStackProvider.","Check for an empty providers array, possibly from a conditional that filtered everything out.","Remove the stack provider if it is not needed."],"exampleFix":null,"handlingStrategy":"validation","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-14T05:17:10.506Z"}