Skip to content

[bug] Using glob syntax in tauri.conf "resources" causes error during build: "error running light.exe" #4126

@nathanbabcock

Description

@nathanbabcock

Describe the bug

Specify glob syntax in tauri.conf.json:

"resources": ["./assets/**/*"],

This will work during dev, and in fact the assets will be properly bundled into both /target/debug/ and /target/release/.

However, it results in this error after running npm run tauri build:

Error running CLI: failed to bundle project: error running light.exe: error running light.exe: ``

Notes:

  • It seems there must be a subfolder inside the /assets folder for the error to occur
  • If the glob syntax is omitted via "resources": ["./assets"], then it seems that assets inside the subfolder are not re-copied during debug

Reproduction

Minimal reproduction in git repo:

  1. git clone https://github.com/nathanbabcock/tauri-app
  2. npm install
  3. npm run tauri build
  4. Error occurs
Error running CLI: failed to bundle project: error running light.exe: error running light.exe: ``

Repro from scratch:

  1. Create an asset in a nested subfolder, e.g. /assets/subfolder/resource.txt
  2. Add these resources to tauri.conf.json using glob syntax: "resources": ["./assets/**/*"]
  3. npm run tauri build
  4. Error occurs
Error running CLI: failed to bundle project: error running light.exe: error running light.exe: ``

Expected behavior

Installer should be correctly bundled when using glob syntax for resources.

Platform and versions

Environment
  › OS: Windows 10.0.19044 X64
  › Webview2: 101.0.1210.39
  › MSVC: 
      - Visual Studio Community 2019
      - Visual Studio Build Tools 2017
  › Node.js: 14.18.0
  › npm: 8.7.0
  › pnpm: Not installed!
  › yarn: Not installed!
  › rustup: 1.24.3
  › rustc: 1.60.0
  › cargo: 1.60.0
  › Rust toolchain: stable-x86_64-pc-windows-msvc 

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.10,
  › tauri-build [RUST]: 1.0.0-rc.8,
  › tao [RUST]: 0.8.4,
  › wry [RUST]: 0.16.2,

App
  › build-type: bundle
  › CSP: unset
  › distDir: ../dist
  › devPath: http://localhost:3000/
  › framework: React

App directory structure
  ├─ .git
  ├─ dist
  ├─ node_modules
  ├─ src
  └─ src-tauri


### Stack trace

```shell
$ npm run tauri build

> tauri-app@0.0.0 tauri
> tauri "build"

     Running beforeBuildCommand `npm run build`

> tauri-app@0.0.0 build
> tsc && vite build

vite v2.9.9 building for production...
✓ 34 modules transformed.
dist/assets/favicon.17e50649.svg   1.49 KiB
dist/assets/logo.ecc203fb.svg      2.61 KiB
dist/index.html                    0.46 KiB
dist/assets/index.62f502b0.css     0.75 KiB / gzip: 0.48 KiB
dist/assets/index.2b0e2339.js      140.35 KiB / gzip: 45.10 KiB
   Compiling app v0.1.0 (F:\git\tauri-app\src-tauri)
    Finished release [optimized] target(s) in 26.50s
        Info Target: x64
     Running candle for "main.wxs"
     Running light to produce F:\git\tauri-app\src-tauri\target\release\bundle/msi/tauri-app_0.1.0_x64_en-US.msi
Error running CLI: failed to bundle project: error running light.exe: error running light.exe: ``


### Additional context

_No response_

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: 1 highHigh priority bugs/missing features or non-crashing regressionstype: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions