Skip to main content

Troubleshooting

Module not initialized

Make sure @quik/metadata is registered in your bootstrap module. Its setup() does nothing beyond making the module discoverable to the bootstrap dependency graph — MetadataStore itself works without any setup step, since it is just a WeakMap wrapper.

Metadata missing after a dynamic property change

Metadata is stored per-decorator context (context.metadata) and does not use runtime reflection of class members. Dynamically adding properties to a class instance, or mutating its shape at runtime, will not be reflected in metadata unless a decorator was applied to those members at definition time.

snapshot() returns stale/empty data

snapshot() is memoized and only recomputes after register/get adds a new key, or after clear() runs. If you mutate an object previously returned by get()/snapshot() in place, those changes are visible immediately (same object reference) — but adding a brand-new metadata key requires a get/register call to invalidate the cache before it shows up in a subsequent snapshot() call.

clear() doesn't fully reset state

MetadataStore.clear() empties the internal cache/snapshot used for enumeration, but the backing WeakMap cannot be cleared. get(metadata) for a previously-seen DecoratorMetadata object will still return its existing contents after clear() — only newly-created decorator contexts (e.g. from redefining classes on a full bootstrap reset) start with empty metadata.

Common Errors

@quik/metadata has no locales/ folder and defines no quik.errors.* keys — it has no typed errors of its own.