Describe the bug
Creating proper builds (release tauri build and debug tauri build --debug) both don't work at all, while development server does work. Development server (tauri dev) works fine, displaying content as expected from the development server. With either a release or a debug build, all that is shown is a white screen.
I am attempting to use tauri with the nuxt v3 release candidate.
Opening the console in a development build shows this:

elements shows this:

It appears to be similar to what .output/public/index.html contains:
<!DOCTYPE html>
<html >
<head >
<link rel="stylesheet" href="/_nuxt/entry.f1888983.css">
</head>
<body >
<!-- unminified the body for more readability -->
<div id="__nuxt"></div>
<script>window.__NUXT__={serverRendered:false,config:{public:{},app:{baseURL:"\u002F",buildAssetsDir:"\u002F_nuxt\u002F",cdnURL:""}}}</script>
<script type="module" src="/_nuxt/entry-521b7af6.mjs"></script>
</body>
</html>
My nuxt.config.ts looks like this:
import { defineNuxtConfig } from "nuxt";
// https://v3.nuxtjs.org/api/configuration/nuxt.config
export default defineNuxtConfig({
telemetry: false,
builder: "vite",
target: "static",
ssr: false
// target: "static" and ssr: false creates a standard SPA according to nuxt docs (unfortunately cannot find again where this is stated, but I have deployed .output/public to gh pages with success before under this configuration setting)
});
Snippet of tauri.conf.json (removed everything else that was default):
{
"build": {
"beforeBuildCommand": "pnpm run build", // nuxt build
"beforeDevCommand": "pnpm run dev", // nuxt dev
"devPath": "http://localhost:3000",
"distDir": "../.output/public"
},
"tauri": {
"bundle": {
"identifier": "custom.identifier"
}
}
}
Reproduction
- init a nuxt app with
pnpm dlx nuxi init nuxt-app
- install tauri cli:
pnpm i -D @tauri-apps/cli
- I installed optional tauri API using
pnpm i -D @tauri-apps/api (unsure if relevant, but I did do this so I included anyway)
- init tauri app with
pnpm create tauri-app
- web assets relative to
<current dir>/src-tauri/tauri.conf.json: I put ../.output/public
- url of dev server left at default (
http://localhost:3000)
- checked
pnpm tauri info (see below)
- I noticed some inaccuracies: I am on an Apple silicon Mac, so I believe OS should be aarch64 or something like that (the build commands do produce aarch64 builds as expected though)
- another inaccuracy: bundler is vite, not webpack (see above,
nuxt.config.ts, perhaps tauri just doesn't recognise nuxt v3 yet? vite support is new in v3 I believe
- change
build.beforeBuildCommand to pnpm run build
- change
build.beforeDevCommand to pnpm run dev
- observe
pnpm tauri dev works
- observe bundle produced by
pnpm tauri build does not work as expected (including the app in the DMG)
- observe bundle produced by
pnpm tauri build --debug does the same thing (also including app in the DMG)
Expected behavior
bundled builds produced by tauri build and tauri build --debug can display the content instead of a blank page
Platform and versions
Environment
› OS: Mac OS 12.3.1 X64
› Node.js: 16.15.0
› npm: 8.9.0
› pnpm: 7.0.1
› yarn: Not installed!
› rustup: 1.24.3
› rustc: 1.60.0
› cargo: 1.60.0
› Rust toolchain: stable-aarch64-apple-darwin
Packages
› @tauri-apps/cli [NPM]: 1.0.0-rc.10
› @tauri-apps/api [NPM]: 1.0.0-rc.5
› tauri [RUST]: 1.0.0-rc.9,
› tauri-build [RUST]: 1.0.0-rc.8,
› tao [RUST]: 0.8.4,
› wry [RUST]: 0.16.0,
App
› build-type: bundle
› CSP: unset
› distDir: ../.output/public
› devPath: http://localhost:3000/
› framework: Vue.js (Nuxt)
› bundler: Webpack
App directory structure
├─ .output
├─ node_modules
├─ src-tauri
├─ .nuxt
└─ .git
Stack trace
None, just the cryptic error as stated above:

Additional context
minimal reproduction repo: https://github.com/autumnblazey/tauri-nuxtv3-repro. Just followed the steps to initialise nuxt, then tauri
some edits for formatting / silly typos
edit 2: added reproduction repo
Describe the bug
Creating proper builds (release
tauri buildand debugtauri build --debug) both don't work at all, while development server does work. Development server (tauri dev) works fine, displaying content as expected from the development server. With either a release or a debug build, all that is shown is a white screen.I am attempting to use tauri with the nuxt v3 release candidate.
Opening the console in a development build shows this:
elements shows this:
It appears to be similar to what
.output/public/index.htmlcontains:My
nuxt.config.tslooks like this:Snippet of
tauri.conf.json(removed everything else that was default):Reproduction
pnpm dlx nuxi init nuxt-apppnpm i -D @tauri-apps/clipnpm i -D @tauri-apps/api(unsure if relevant, but I did do this so I included anyway)pnpm create tauri-app<current dir>/src-tauri/tauri.conf.json: I put../.output/publichttp://localhost:3000)pnpm tauri info(see below)nuxt.config.ts, perhaps tauri just doesn't recognise nuxt v3 yet? vite support is new in v3 I believebuild.beforeBuildCommandtopnpm run buildbuild.beforeDevCommandtopnpm run devpnpm tauri devworkspnpm tauri builddoes not work as expected (including the app in the DMG)pnpm tauri build --debugdoes the same thing (also including app in the DMG)Expected behavior
bundled builds produced by
tauri buildandtauri build --debugcan display the content instead of a blank pagePlatform and versions
Stack trace
None, just the cryptic error as stated above:
Additional context
minimal reproduction repo: https://github.com/autumnblazey/tauri-nuxtv3-repro. Just followed the steps to initialise nuxt, then tauri
some edits for formatting / silly typos
edit 2: added reproduction repo