You’re right that the snippet in the docs assumes Vite/Vitest-style globals, but the documentation doesn’t explicitly say you must have vite (and its types) installed.
The relevant section shows:
export const modules = import.meta.glob(
"./**/!(*.*.*)*.*s"
);
and then uses modules with convexTest(schema, modules). [convex-test get-started]
From the docs alone:
- They rely on
/// <reference types="vite/client" />, which is what provides the ImportMeta augmentation and import.meta.glob. [convex-test get-started]
- They don’t mention that you must install
vite (or otherwise provide those types) if your project isn’t already using Vite.
So:
- Your two errors (
Cannot find type definition file 'vite/client' and Property 'glob' does not exist on type 'ImportMeta') are exactly what you’d expect in a non‑Vite project that copies this snippet as‑is.
- Installing
vite as a dev dependency (or otherwise adding the vite/client types) is a reasonable fix, but this requirement is not called out in the docs.
Based on the provided sources, there’s no explicit guidance about this edge case, so the documentation could indeed be clearer for non‑Vite setups (e.g. by stating that the snippet assumes Vite/Vitest and vite/client types, or by offering an alternative that doesn’t rely on import.meta.glob). The knowledge sources don’t say whether this is considered a docs bug vs. a setup issue, only how to wire modules when using Vite.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: