chore(lib/plugins): update init+ error message with hints
This commit is contained in:
parent
73534bda6a
commit
912fa8e896
1 changed files with 2 additions and 1 deletions
|
|
@ -43,7 +43,8 @@ defineLazyProperties(pUnscopedApi, {
|
||||||
export function guardIndexInitialized(name: string) {
|
export function guardIndexInitialized(name: string) {
|
||||||
if (!isModuleInitialized(0))
|
if (!isModuleInitialized(0))
|
||||||
throw new Error(
|
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.',
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue