Skip to content

[bug] Allow the use of target dir inside frontendDist/distDir #13287

@jdalegonzalez

Description

@jdalegonzalez

Describe the bug

If you define a path in your app like http://localhost:3000/target, you'll get a folder in your ./out directory called ./out/target that includes the resources for that path. The tauri build sees this folder and generates a build error
"The configured distDir includes the ["target"] folder. Please isolate your web assets on a separate folder and update tauri.conf.json > build > distDir." Renaming the path to something else fixes the problem but that sucks if you really want the name of the path to be target.

Reproduction

Create a next-js app and add a src/pages/target/index.ts
run npm tauri build
See failure.

Expected behavior

The builder shouldn't care about the name of the paths in the out folder

Full tauri info output

[✔] Environment
    - OS: Windows 10.0.26100 X64
    ✔ WebView2: 135.0.3179.85
    ✔ MSVC: Visual Studio Build Tools 2022
    ✔ rustc: 1.86.0 (05f9846f8 2025-03-31)
    ✔ cargo: 1.86.0 (adf9b6ad1 2025-02-28)
    ✔ rustup: 1.28.1 (f9edccde0 2025-03-05)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 22.14.0
    - pnpm: 10.9.0
    - npm: 11.1.0

[-] Packages
    - tauri [RUST]: 1.8.2
    - tauri-build [RUST]: 1.5.6
    - wry [RUST]: 0.24.11
    - tao [RUST]: 0.16.10
    - @tauri-apps/api : not installed!
    - @tauri-apps/cli [NPM]: 1.6.3 (outdated, latest: 2.5.0)

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../out
    - devPath: http://localhost:3000/
    - framework: React (Next.js)
    - bundler: Webpack

Stack trace


Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions