Vite
Status: keep Vite on Node.js for now. We tried the official
react-ts template (Vite 8) and a minimal Vite 6 project.
What we tried
3va create vite vite-app --template react-ts # runs create-vite through npm
cd vite-app
3va install --allow-net=registry.npmjs.org1. The install almost passes the malware scanner. Vite, rolldown,
TypeScript 6 and @types/node are accepted. Only the template’s linter
is still rejected:
✗ oxlint@1.85.0 — install aborted by security scanReview it and trust that exact version in package.json,
"3va": { "trusted": ["oxlint@1.85.0"] }, or drop it from
devDependencies. With the pin, it installed in our test.
2. Native binaries are installed. @rolldown/binding-linux-x64-gnu and
lightningcss-linux-x64-gnu arrive as platform-specific optional
dependencies (only the -gnu builds on a glibc system), and
node_modules/.bin has vite, tsc and rolldown.
3. The Vite CLI doesn’t start under 3va:
$ 3va run node_modules/vite/bin/vite.js -- build
Error: [parse] SyntaxError: Invalid or unexpected tokenImporting Vite directly (import("vite")) fails with
Cannot use 'import.meta' outside a module.
What about 3va dev?
3va dev is 3va’s own Vite-style dev server (on-demand ESM, TS/JSX
transpiling, reload on save). It serves the Vite project’s files, but the
React template doesn’t render in the browser:
Uncaught SyntaxError: The requested module '/node_modules/react/index.js'
does not provide an export named 'useState'React is published as CommonJS, and 3va dev doesn’t expose named ESM
exports for CommonJS packages yet. Importing images
(import hero from "./assets/hero.png") also breaks the initial bundle:
stream did not contain valid UTF-8.
3va dev works well for plain TS/JS frontends that don’t depend on
CommonJS packages (see example 06 and
example 13).
A setup that works today
Keep the frontend toolchain on Node and move the rest:
{
"scripts": {
"dev": "vite",
"build": "vite build",
"test": "3va test",
"api": "3va run server/index.ts"
}
}npm install/pnpm installfor dependencies (native binaries included)vite/vite buildon Node for the frontend3va testfor unit tests of pure logic3va run/3va startfor the backend the frontend talks to
Things to keep in mind
3va create viteneeds npm installed: it delegates tonpm exec create-vite.vite.config.tsplugins run inside Vite’s process, so they stay on Node too.import.meta.envis undefined under3va dev:import.meta.env?.MODEand?.DEVboth came back empty. It injects aprocess.env.NODE_ENVshim instead, andVITE_*variables aren’t exposed.