tauri-apps/tauri

[bug] `tauri.conf.json` error on `build`: Additional properties are not allowed ('distDir' was unexpected)

Closed this issue · 2 comments

Describe the bug

When using @tauri-apps/cli and vite-plugin-tauri at the same time, a packaging error occurs: tauri.conf.json error on build: Additional properties are not allowed ('distDir' was unexpected)

"@tauri-apps/api": "^2.0.3",
"@tauri-apps/cli": "^2.0.4",
"vite-plugin-tauri": "^3.3.0"

Reproduction

No response

Expected behavior

No response

Full tauri info output

vite v5.4.10 building for production...
✓ 7 modules transformed.
dist/index.html                 0.63 kB │ gzip: 0.38 kB
dist/assets/logo-BKhbptE1.svg   1.60 kB │ gzip: 0.55 kB
dist/assets/index-BDKmSVny.css  0.39 kB │ gzip: 0.16 kB
dist/assets/index-3SGzxpHH.js   6.67 kB │ gzip: 2.79 kB
✓ built in 226ms
    Error `tauri.conf.json` error on `build`: Additional properties are not allowed ('distDir' was unexpected)
 ELIFECYCLE  Command failed with exit code 1.
beforeBuildCommand `pnpm build` failed with exit code 1
    Error beforeBuildCommand `pnpm build` failed with exit code 1
 ELIFECYCLE  Command failed with exit code 1.

Stack trace

No response

Additional context

No response

tauri.conf.json configuration

{
"$schema": "https://schema.tauri.app/config/2",
"productName": "tauri-template",
"version": "0.1.0",
"identifier": "com.tauri-template.app",
"build": {
"devUrl": "http://localhost:1420",
"beforeDevCommand": "pnpm dev",
"beforeBuildCommand": "pnpm build",
"frontendDist": "../dist"
},
"app": {
"windows": [
{
"title": "tauri-template",
"width": 1200,
"height": 800
}
],
"security": {
"csp": null
}
},
"bundle": {
"active": true,
"targets": "all",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
]
}
}

vite-plugin-tauri only works with tauri v1 right now. Please open an issue in its repo instead.