Skip to content

[bug] Resources with $ in their name make build step fail on Windows #9657

@enkhjile

Description

@enkhjile

Describe the bug

I'm working on an app that utilizes JNI to call Java. In my Java class, I have inner classes that should be named OuterClass$InnerClass.class after compilation. However, these inner class files cannot be found during the build step. It appears that the $ symbol is being improperly escaped with another $, causing the build step to fail.

Reproduction

  1. Create a Next.js Tauri app using Next.js.
  2. Add a resource with $ in its name to the tauri.conf.json.
  3. Build the app.

Expected behavior

The build step should finish with included resources.

Full tauri info output

[✔] Environment
    - OS: Windows 10.0.22621 X64
    ✔ WebView2: 124.0.2478.67
    ✔ MSVC: 
        - Visual Studio Community 2019
        - Visual Studio Community 2022
    ✔ rustc: 1.77.1 (7cf61ebde 2024-03-27)
    ✔ cargo: 1.77.1 (e52e36006 2024-03-26)
    ✔ rustup: 1.27.0 (bbb9276d2 2024-03-08)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (environment override by RUSTUP_TOOLCHAIN)
    - node: 20.12.0
    - pnpm: 8.15.6
    - npm: 10.5.0

[-] Packages
    - tauri [RUST]: 1.5.4
    - tauri-build [RUST]: 1.5.1
    - wry [RUST]: 0.24.7
    - tao [RUST]: 0.16.7
    - tauri-cli [RUST]: 1.5.11
    - @tauri-apps/api [NPM]: 1.5.3 (outdated, latest: 1.5.4)
    - @tauri-apps/cli [NPM]: 1.5.11 (outdated, latest: 1.5.12)

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

Stack trace

The actual file is named WebFXScan$CImageInfo.class

File: "C:\Users\enkhj\projects\pms-mirai-app\src-tauri\java\adview\webfxscan\WebFXScan$$CImageInfo.class" -> no files found.
Usage: File [/nonfatal] [/a] ([/r] [/x filespec [...]] filespec [...] |
   /oname=outfile one_file_only)
Error in script "C:\Users\enkhj\projects\pms-mirai-app\src-tauri\target\release\nsis\x64\installer.nsi" on line 563 -- aborting creation process
       Error failed to bundle project: `The system cannot find the file specified. (os error 2)`

Additional context

It works fine on MacOS

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