You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I scaffolded an app using the Vite/TS default and when I build, I get:
raymondcamden@Juniper-Montage-4 myapp2 % tinyjs build
==> bundling backend (esbuild)
==> frontend build: npm run build
> [email protected] build
> tsc && vite build --base=./
error TS2688: Cannot find type definition file for 'vite/client'.
The file is in the program because:
Entry point of type library 'vite/client' specified in compilerOptions
tsconfig.json:6:15 - File is entry point of type library specified here.
6 "types": ["vite/client"],
~~~~~~~~~~~~~
As far as I know, I didn't change anything after scaffolding.
Thanks for the report @cfjedimaster. I can reproduce it: this happens when the scaffolded project's packages aren't installed yet. tinyjs new --template … prints npm install as the next step, but nothing enforced it. Without node_modules, npm run build runs tsc && vite build, picks up a globally installed tsc, and that can't find vite/client's types, which gives exactly this error.
Workaround now: run npm install in the project, then tinyjs build (or tinyjs dev).
Fix (next release):tinyjs build and tinyjs dev check for installed packages before running the project's own build or dev command, and stop with "no node_modules for this project … run npm install first" instead of the tool's error. A node_modules in a parent folder (workspaces) and Yarn PnP both count. The same branch also documents the folder settings: "backend" picks the backend entry, and "frontend": { "dir": … } picks the plain page folder (default src/frontend).
Fixed in v0.49.0: tinyjs build and tinyjs dev now stop with "run npm install first" when a bundler project has no node_modules. The folder settings ("backend", "frontend": { "dir" }) are documented too. Thanks again @cfjedimaster.
Activity
tarwin commentedon Oct 5, 2026
Thanks for the report @cfjedimaster. I can reproduce it: this happens when the scaffolded project's packages aren't installed yet.
tinyjs new --template …printsnpm installas the next step, but nothing enforced it. Withoutnode_modules,npm run buildrunstsc && vite build, picks up a globally installedtsc, and that can't findvite/client's types, which gives exactly this error.Workaround now: run
npm installin the project, thentinyjs build(ortinyjs dev).Fix (next release):
tinyjs buildandtinyjs devcheck for installed packages before running the project's own build or dev command, and stop with "no node_modules for this project … runnpm installfirst" instead of the tool's error. Anode_modulesin a parent folder (workspaces) and Yarn PnP both count. The same branch also documents the folder settings:"backend"picks the backend entry, and"frontend": { "dir": … }picks the plain page folder (defaultsrc/frontend).docs(verify): #41 parent-dir node_modules walk verified on Windows
release: v0.49.0 — About panel Credits.html/attribution, npm install …
tarwin commentedon Oct 5, 2026
Fixed in v0.49.0:
tinyjs buildandtinyjs devnow stop with "runnpm installfirst" when a bundler project has nonode_modules. The folder settings ("backend","frontend": { "dir" }) are documented too. Thanks again @cfjedimaster.