Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tauri build cli.js fails with empty error #3062

Closed
fogine opened this issue Dec 13, 2021 · 13 comments
Closed

tauri build cli.js fails with empty error #3062

fogine opened this issue Dec 13, 2021 · 13 comments
Labels
status: invalid This is not a valid issue

Comments

@fogine
Copy link

fogine commented Dec 13, 2021

Describe the bug

The build command yarn tauri:build fails while bundling files after successful compilation.
I tracked it down to line

rejectCb = () => reject(new Error())

which throws empty error when a shell spawn command returns none zero exit code..
 yarn tauri:build --verbose doesnt print any more information..

Expected behavior

The error should say something as it currently dooesnt say anything and I dont know whats going on.

Platform and Versions (required):

Operating System - Arch Linux, version Unknown X64

Node.js environment
  Node.js - 16.13.1
  @tauri-apps/cli - 1.0.0-beta.6
  @tauri-apps/api - 1.0.0-beta.8

Global packages
  npm - 8.1.2
  yarn - 1.22.17

Rust environment
  rustc - 1.53.0
  cargo - 1.53.0

App directory structure
/src
/dist
/bdscli
/public
/.git
/bds
/node_modules
/src-tauri

App
  tauri.rs - 1.0.0-beta.8
  build-type - bundle
  CSP - default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'
  distDir - Set automatically by Vue CLI plugin
  devPath - Set automatically by Vue CLI plugin
  framework - Vue.js (Vue CLI)
  bundler - Webpack


Additional context

Add any other context about the problem here.

Stack Trace

DONE Build complete. The src-tauri/target/webpack_dist directory is ready to be deployed.
INFO Check out deployment instructions at https://cli.vuejs.org/guide/deployment.html

app:spawn Running "node_modules/@tauri-apps/cli/bin/tauri-cli tauri build --config {"build":{"distDir":"./target/webpack_dist"}} --verbose" +0ms

Compiling app v0.1.0 (/path/to/app)
Finished release [optimized] target(s) in 52.71s
Bundling bdsgui_0.4.0_amd64.deb
Error: failed to bundle project

Caused by:
0: Failed to build data folders and files
1: Failed to build data folders and files
2: Failed to create icon files
3: Failed to create icon files
4: invalid RLE-compressed data
5: invalid RLE-compressed data

app:spawn Command "node_modules/@tauri-apps/cli/bin/tauri-cli" failed with exit code: 1 +0ms

Error
at d (node_modules/@tauri-apps/cli/dist/api/cli.js:1:9522)
at v (node_modules/@tauri-apps/cli/dist/api/cli.js:1:9563)
at ChildProcess. (node_modules/@tauri-apps/cli/dist/api/cli.js:1:10706)
at ChildProcess.emit (node:events:390:28)
at maybeClose (node:internal/child_process:1064:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@fogine
Copy link
Author

fogine commented Dec 14, 2021

it was caused by corrupted icons/icon.icns image

@fogine fogine closed this as completed Dec 14, 2021
@amrbashir amrbashir added status: invalid This is not a valid issue and removed type: bug labels Dec 14, 2021
@liudonghua123
Copy link

liudonghua123 commented Dec 19, 2021

I have the same problems, I use yarn tauri icon to regenerate the icons. @fogine How do you check corrupted icons/icon.icns image. icns file is seemed to be a macos icon file format.

I have checked the icns on a macos, there are 10 icons in this icns and it seemed no problem.

icons.zip

I tried to remove the icns and tried again. Then the following errors shown.

liudonghua@DESKTOP-DELL:/mnt/d/code/rust/hoppscotch-app$ yarn tauri build -t x86_64-unknown-linux-gnu --verbose
yarn run v1.22.17
$ tauri build -t x86_64-unknown-linux-gnu --verbose
 app:spawn Running "/mnt/d/code/rust/hoppscotch-app/node_modules/@tauri-apps/cli/bin/tauri-cli tauri build -t x86_64-unknown-linux-gnu --verbose" +0ms

   Compiling app v0.1.0 (/mnt/d/code/rust/hoppscotch-app/src-tauri)
    Finished release [optimized] target(s) in 3m 48s
    Bundling hoppscotch-app_2.1.0_amd64.deb
Error: failed to bundle project

Caused by:
    0: Failed to build data folders and files
    1: Failed to build data folders and files
    2: Failed to create icon files
    3: Failed to create icon files
    4: `Path matching 'icons/icon.icns' not found`

 app:spawn Command "/mnt/d/code/rust/hoppscotch-app/node_modules/@tauri-apps/cli/bin/tauri-cli" failed with exit code: 1 +0ms
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
liudonghua@DESKTOP-DELL:/mnt/d/code/rust/hoppscotch-app$

And When I just replaced icon.icns with the origin default one. Then it built success.

@yeus
Copy link

yeus commented Mar 16, 2022

I am not sure, why this is close,d but this is still a problem... when building icons with tauricon I get this error message:

Error running CLI: failed to bundle project: Failed to build data folders and files: Failed to build data folders and files: Failed to create icon files: Failed to create icon files: `invalid RLE-compressed data`: invalid RLE-compressed data

more info:

Operating System - Ubuntu, version 20.04 X64

Node.js environment
  Node.js - 17.7.1
  @tauri-apps/cli - 1.0.0-rc.6
  @tauri-apps/api - 1.0.0-rc.2

Global packages
  npm - 8.5.2
  pnpm - Not installed
  yarn - 1.22.17

Rust environment
  rustup - Not installed
  rustc - 1.57.0
  cargo - 1.57.0
  toolchain - Not installed

App directory structure
/src-pwa
/node_modules
/public
/.vscode
/dist
/src-ssr
/.quasar
/src-electron
/src
/src-tauri

App
  tauri - 1.0.0-rc.4
  tauri-build - 1.0.0-rc.4
  tao - 0.6.4
  wry - 0.13.3
  build-type - bundle
  CSP - unset
  distDir - ../dist/spa
  devPath - http://localhost:8080/
  framework - Vue.js (Quasar)
  bundler - Webpack
Done in 11.18s.

@Weiyi-Feng
Copy link

Same issue

[tauri:build] Binary stripped, size reduced by 7.37 MB
    Bundling acrn-configurator_0.2.1_amd64.deb
[Error: failed to bundle project: Failed to build data folders and files: Failed to build data folders and files: Failed to create icon files: Failed to create icon files: `invalid RLE-compressed data`: invalid RLE-compressed data] {
  code: 'GenericFailure'
}
error Command failed with exit code 1.

@Daniel-Knights
Copy link

Daniel-Knights commented Apr 29, 2022

I'm having the same issue as part of a GitHub workflow:

    ...
    Finished release [optimized] target(s) in 8m 51s
    Bundling note-boi_0.1.0_amd64.deb
Error running CLI: failed to bundle project: Failed to build data folders and files: Failed to build data folders and files: Failed to create icon files: Failed to create icon files: `invalid RLE-compressed data`: invalid RLE-compressed data
Error: Command failed with exit code 1: npx tauri build

Tried deleting the icons and re-packaging them, but it didn't help.

@Daniel-Knights
Copy link

Fixed this by adding a tauri.linux.conf.json with this in (icons/icon.icns is removed):

{
  "tauri": {
    "bundle": {
      "identifier": "com.daniel-knights.note-boi",
      "icon": [
        "icons/32x32.png",
        "icons/128x128.png",
        "icons/128x128@2x.png",
        "icons/icon.ico"
      ]
    }
  }
}

No idea if this is the right approach, though.

@lucasfernog
Copy link
Member

Can you share the icon you're using @Daniel-Knights ? I'd like to fix this issue.

@lucasfernog lucasfernog reopened this Apr 29, 2022
@Daniel-Knights
Copy link

Daniel-Knights commented Apr 29, 2022

Sure thing @lucasfernog, it's this one.

@liudonghua123
Copy link

I have the same issue a few months ago. It seemed that the icns is generated using nodejs, but used in rust, maybe this will have some incompatible issues in these processes.

@lucasfernog
Copy link
Member

Tauricon has been updated, it'll generate a ICNS that can be used in the debian bundle now.

@Daniel-Knights
Copy link

Really appreciate the quick response @lucasfernog, but I think there's a problem with the latest release. I've opened an issue for it here

dceddia pushed a commit to dceddia/tauri that referenced this issue May 14, 2022
tauri-apps#4009)

* fix(bundler): debian failing to load icns icon, closes tauri-apps#3062

* fix change file
@adelynx
Copy link

adelynx commented Aug 24, 2022

This issue is still not been fixed

error:

    Bundling myapp_0.0.1_amd64.deb (~/Projects/tauri-app/src-tauri/target/debug/bundle/deb/myapp_0.0.1_amd64.deb)
       Error failed to bundle project: Failed to build data folders and files: Failed to build data folders and files: Failed to create icon files: Failed to create icon files: path matching icons/icon.icns not found.: path matching icons/icon.icns not found.
error Command failed with exit code 1.
Environment
  › OS: Ubuntu 22.04 X64
  › Node.js: 16.16.0
  › npm: 8.15.0
  › pnpm: Not installed!
  › yarn: 1.22.19
  › rustup: 1.25.1
  › rustc: 1.63.0
  › cargo: 1.63.0
  › Rust toolchain: stable-x86_64-unknown-linux-gnu 

Packages
  › @tauri-apps/cli [NPM]: 1.0.5
  › @tauri-apps/api [NPM]: 1.0.2
  › tauri [RUST]: 1.0.5,
  › tauri-build [RUST]: 1.0.4,
  › tao [RUST]: 0.12.2,
  › wry [RUST]: 0.19.0,

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

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

@FabianLars
Copy link
Sponsor Member

@adelynx That looks like a completely different issue, it sounds like you still have icons/icon.ico mentioned in tauri.conf.json but removed the actual file from the disk, could that be?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid This is not a valid issue
Projects
None yet
Development

No branches or pull requests

9 participants