top of page
Search

From AI Scaffold to Portable Tauri .exe: A Technical Walkthrough

Writer: Chrissy
Chrissy
Oct 17
2 min read

I scaffolded a TanStack Start + React app using Lovable, then wrapped it as a desktop application with Tauri. The goal: a single portable .exe with no installer.

Here's what actually went wrong and how I fixed it, step by step.

1. Debug vs. Release

I initially pinned the app from the dev command to my taskbar and assumed that was the build. It's not — tauri dev runs a debug binary from src-tauri/target/debug/ that's tied to the dev server. The portable binary lives in src-tauri/target/release/ and only exists after running the build command.

npx tauri dev      # debug — NOT portable
npx tauri build    # release — produces the portable .exe

2. Missing Identifier

First npx tauri build failed:

error: identifier must be a valid reverse domain name

The tauri.conf.json still had the default identifier. Changed it:

"identifier": "com.itcompanion.app"

Build proceeded further.

3. frontendDist Path Mismatch

Next error:

error: The `frontendDist` configuration is set to '../dist' but this path doesn't exist

The default Tauri template expects a Vite project that outputs to dist/. My project uses TanStack Start, which outputs to a hidden .output/ folder (note the leading dot — invisible in File Explorer by default). Changed it to:

"frontendDist": "../.output/public"

That got Tauri to find the folder, but introduced the next problem.

4. Missing index.html

Build "succeeded" but the resulting .exe opened a blank window. The Tauri build log showed:

warning: asset not found: index.html

TanStack Start in SSR mode outputs _shell.html, not index.html. Tauri hard-requires a file literally named index.html to embed as the app's entry point.

Fix: Enabled SPA mode in vite.config.ts:

import { defineConfig } from "@lovable.dev/vite-tanstack-config";

export default defineConfig({
  tanstackStart: {
    server: { entry: "server" },
    spa: {
      enabled: true,
      prerender: {
        outputPath: "index.html",
      },
    },
  },
});

spa.enabled: true tells TanStack Start to skip SSR and produce a static client-side bundle. prerender.outputPath overrides the default _shell.html filename to index.html.

After this, npm run build produced .output/public/index.html, and npx tauri build embedded it into the .exe correctly.

5. Distribution

Published the resulting app.exe (renamed to IT-Companion.exe) as a GitHub Release binary attachment. Anyone can download it from the release page and double-click — no Node.js, no install, just WebView2 (pre-installed on Windows 10/11).

Stack: TanStack Start · React · Tailwind · Tauri v2 · Vite (via @lovable.dev/vite-tanstack-config)

Key lesson: The gap between "AI generated my app" and "I can ship a portable binary" is entirely in the build tooling — config paths, output conventions, and framework-specific quirks. None of that is in the generated code. You learn it by reading build errors. https://github.com/ChrisLearningCode2/IT-Companion/releases


 
 
 

Comments


© 2025 by Chrissy. Powered and secured by Wix

bottom of page