跳到主要内容

RxDBMissingPluginError

Defined in: packages/rxdb/src/RxDBError.ts:158

声明了某个策略、却没装提供它的插件。

Remarks​

US-025 阶段 B 把 QueryCache 读引擎搬进 @aiao/rxdb-plugin-querycache,但 SyncType.QueryCache 这个取值留在核心(策略轴闭合,Repository 的分支要靠它判定)。 缺口因此是结构性的:配置写得出来,实现可能不在。

阶段 D 之后同一个实体有两个这样的缺口:读引擎在 querycache 插件,出站队列在 @aiao/rxdb-plugin-sync。两处各抛各的,靠 RxDBMissingPluginError.subject 区分 —— 装了一个没装另一个的人,读到的必须是还缺哪一半,而不是一句对他已经不成立的 「引擎没装」。

抛在 connect() 里而不是等到第一次 find():配置错误要在启动时响。也不降级为本地读 —— 降级之后调用方看到的是「远端没有数据」,与 RxDBQueryCacheCapabilityError 拒绝降级是同一条理由。

Example​

import { rxDBPluginQueryCache } from '@aiao/rxdb-plugin-querycache';

rxdb.use(rxDBPluginQueryCache);
await rxdb.connect('sqlite');

Extends​

Constructors​

Constructor​

new RxDBMissingPluginError(
entity,
capability,
packageName,
registration,
subject?
): RxDBMissingPluginError;

Defined in: packages/rxdb/src/RxDBError.ts:159

Parameters​

ParameterTypeDefault valueDescription
entitystringundefined触发这条错误的实体名(元数据里的 name)
capabilitystringundefined该实体声明的、需要插件支撑的能力
packageNamestringundefined要安装的包名
registrationstringundefined装上之后的注册写法
subjectstring'engine'缺的那一半叫什么,嵌进 no ${subject} is installed。

Returns​

RxDBMissingPluginError

Overrides​

RxDBError.constructor

Properties​

capability​

readonly capability: string;

Defined in: packages/rxdb/src/RxDBError.ts:163

该实体声明的、需要插件支撑的能力


cause?​

optional cause?: unknown;

Defined in: node_modules/.pnpm/typescript@6.0.3_patch_hash=ef3c2292deb88eb14130359d5acc1febc0226af46b7b945db6c7250c6cb4efbb/node_modules/typescript/lib/lib.es2022.error.d.ts:24

Inherited from​

RxDBError.cause


entity​

readonly entity: string;

Defined in: packages/rxdb/src/RxDBError.ts:161

触发这条错误的实体名(元数据里的 name)


message​

message: string;

Defined in: node_modules/.pnpm/typescript@6.0.3_patch_hash=ef3c2292deb88eb14130359d5acc1febc0226af46b7b945db6c7250c6cb4efbb/node_modules/typescript/lib/lib.es5.d.ts:1075

Inherited from​

RxDBError.message


name​

name: string;

Defined in: node_modules/.pnpm/typescript@6.0.3_patch_hash=ef3c2292deb88eb14130359d5acc1febc0226af46b7b945db6c7250c6cb4efbb/node_modules/typescript/lib/lib.es5.d.ts:1074

Inherited from​

RxDBError.name


packageName​

readonly packageName: string;

Defined in: packages/rxdb/src/RxDBError.ts:165

要安装的包名


registration​

readonly registration: string;

Defined in: packages/rxdb/src/RxDBError.ts:167

装上之后的注册写法


stack?​

optional stack?: string;

Defined in: node_modules/.pnpm/typescript@6.0.3_patch_hash=ef3c2292deb88eb14130359d5acc1febc0226af46b7b945db6c7250c6cb4efbb/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from​

RxDBError.stack


subject​

readonly subject: string = 'engine';

Defined in: packages/rxdb/src/RxDBError.ts:173

缺的那一半叫什么,嵌进 no ${subject} is installed。

Default Value​

'engine'


stackTraceLimit​

static stackTraceLimit: number;

Defined in: node_modules/.pnpm/@types+node@26.6.3/node_modules/@types/node/globals.d.ts:67

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from​

RxDBError.stackTraceLimit

Methods​

captureStackTrace()​

static captureStackTrace(targetObject, constructorOpt?): void;

Defined in: node_modules/.pnpm/@types+node@26.6.3/node_modules/@types/node/globals.d.ts:51

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();

Parameters​

ParameterType
targetObjectobject
constructorOpt?Function

Returns​

void

Inherited from​

RxDBError.captureStackTrace


prepareStackTrace()​

static prepareStackTrace(err, stackTraces): any;

Defined in: node_modules/.pnpm/@types+node@26.6.3/node_modules/@types/node/globals.d.ts:55

Parameters​

ParameterType
errError
stackTracesCallSite[]

Returns​

any

See​

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from​

RxDBError.prepareStackTrace