From 912fa8e896b9be7e7ec48d316ae3b9575ddd464a Mon Sep 17 00:00:00 2001 From: PalmDevs Date: Sat, 1 Aug 2026 15:43:34 +0700 Subject: [PATCH] chore(lib/plugins): update init+ error message with hints --- lib/plugins/src/apis/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/plugins/src/apis/index.ts b/lib/plugins/src/apis/index.ts index f76ed31..24bba78 100644 --- a/lib/plugins/src/apis/index.ts +++ b/lib/plugins/src/apis/index.ts @@ -43,7 +43,8 @@ defineLazyProperties(pUnscopedApi, { export function guardIndexInitialized(name: string) { if (!isModuleInitialized(0)) throw new Error( - `Cannot access ${name} API before the init phase: Index module (ID 0) must be initialized first.`, + `Cannot access ${name} API before the init phase: Index module (ID 0) must be initialized first.\n` + + 'Place your accessing code in the `init() { ... }` block or use `onModuleInitialized(0, () => { ... })` to ensure that the index module is initialized before accessing the API.', ) }