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

[bug] tauri build hangs if icons point to invalid file #3146

Closed
MasterOdin opened this issue Jan 1, 2022 · 5 comments
Closed

[bug] tauri build hangs if icons point to invalid file #3146

MasterOdin opened this issue Jan 1, 2022 · 5 comments

Comments

@MasterOdin
Copy link

MasterOdin commented Jan 1, 2022

Describe the bug

In the src-tauri/tauri.conf.json file, I misconfigured the tauri -> bundle -> icon array such that it pointed at invalid file paths. When running tauri build, it would then hang on the first "building" step, providing no further feedback until I killed the process. Passing --verbose and --debug provided no further information.

Reproduction

  1. Create an app
  2. Edit tauri -> bundle -> icon so that it has an invalid path
  3. See tauri build hang

Expected behavior

tauri build would not hang, probably returning an error that the icon could not be found or something.

Platform and versions

Operating System - Mac OS, version 12.1.0 X64

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

Global packages
  npm - 8.1.2
  yarn - 1.22.17

Rust environment
  rustc - 1.57.0
  cargo - 1.57.0

App directory structure
/.husky
/node_modules
/public
/.github
/src-tauri
/build
/.git
/builder
/src

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 - ../build
  devPath - http://127.0.0.1:3000
  framework - React
@amrbashir
Copy link
Member

amrbashir commented Jan 1, 2022

On my windows machine, I can't reproduce this, specifying an invalid path will make the build process fail and not hang. Please provide a minimal repro.

@MasterOdin
Copy link
Author

I'm getting the hang consistently in https://github.com/MasterOdin/toychest.dev/tree/tauri-test. Changing

https://github.com/MasterOdin/toychest.dev/blob/ad17b3577e041be05983df123b19349e4a037739/src-tauri/tauri.conf.json#L18

to be "../builder/resources/32x32.png" will get it to successfully bundle.

@amrbashir
Copy link
Member

I tried your branch and it built just fine.
Steps:

git clone https://github.com/MasterOdin/toychest.dev --branch tauri-test
cd tauri-test
yarn
yarn tauri build

It should throw an error instead but anyways it didn't just hang indefinitely.
Also I am on Windows, and I see that you're on macOS, so I will wait until someone else can confirm this behavior.

@amrbashir amrbashir added the status: needs more info Issue needs more information, discussion or reproducible example label Jan 1, 2022
@MasterOdin
Copy link
Author

MasterOdin commented Jan 2, 2022

For posterity, my output on running above:

$ yarn tauri build
yarn run v1.22.17
$ tauri build
 app:spawn Running "/Users/mpeveler/code/github/toychest.dev/node_modules/@tauri-apps/cli/bin/tauri-cli tauri build" +0ms

[tauri:build] Running `yarn build`
$ craco build
(node:40462) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /Users/mpeveler/code/github/toychest.dev/node_modules/postcss-safe-parser/node_modules/postcss/package.json.
Update this package.json to use a subpath pattern like "./*".
(Use `node --trace-deprecation ...` to show where the warning was created)
Creating an optimized production build...
Compiled successfully.

File sizes after gzip:

  176.55 KB  build/static/js/2.2aecd05e.chunk.js
  2.43 KB    build/static/js/main.3d514525.chunk.js
  1.91 KB    build/static/css/main.60ee5991.chunk.css
  1.63 KB    build/static/js/3.2df26873.chunk.js
  1.17 KB    build/static/js/runtime-main.7f15fc73.js

The project was built assuming it is hosted at ./.
You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.

Find out more about deployment here:

  https://cra.link/deployment

   Compiling app v0.1.0 (/Users/mpeveler/code/github/toychest.dev/src-tauri)
    Finished release [optimized] target(s) in 34.15s
    Bundling toychest.dev.app

and it hangs there indefinitely. Fixing the path for the icon, and it finishes as expected.

@probablykasper
Copy link
Member

Can confirm it happens on https://github.com/probablykasper/tauri-template (npm i && npm run build). Gets stuck at 100% CPU.

@amrbashir amrbashir added platform: macOS and removed status: needs more info Issue needs more information, discussion or reproducible example labels Jan 2, 2022
@lucasfernog lucasfernog self-assigned this Jan 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants
@MasterOdin @probablykasper @lucasfernog @amrbashir and others