awesomeapp-dev / rust-desktop-app

Base desktop application code with Tauri, Native Web Components and SurrealDB (follow the VMES app architecture)
Apache License 2.0
249 stars 26 forks source link

Missing some files at compile time. src-tauri/icons/32x32.png: No such file or directory (os error 2) #2

Open koakh opened 1 year ago

koakh commented 1 year ago

Hello

first, congratulations for the awesome video about this surreal technologies, what a tech stack, the best combination ever :) one of the best tauri | surrealdb videos I ever see

so well explained and clear, a bit complex to for new comers

I try to compile the project and have bellow error

   Compiling ts-rs v6.2.0
   Compiling webkit2gtk v0.18.1
error: proc macro panicked
  --> src/main.rs:47:8
   |
47 |         .run(tauri::generate_context!())
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: message: failed to read icon /mnt/storage/Development/SurrealDb/@ShowCase/RustTauriAwesomeAppWithSurrealDB/src-tauri/icons/32x32.png: No such file or directory (os error 2)

error: could not compile `app` due to previous error
FAIL - Fail to execute cargo cause: 

I note you have a file in your video that in not here Awesome.toml can you upload all files like you have in the video that way we can follow it

thanks @jeremychone

once more great job with this embedded surrealdb tauri project :)

Koakh

jeremychone commented 1 year ago

First, thanks for the kind words and trying it out.

Now to build it manually, you can repeat what the awesome-app dev does by running the following commands (but will take some effort to have the concurrency and all, this is what awesome-app dev does)

[[dev.runners]]
name = "npm_install"
cmd = "npm"
args = ["install"]

[[dev.runners]]
name = "tauri_icons"
when.no_file_at = "src-tauri/icons/32x32.png"
cmd = "npm"
args = ["run", "tauri", "icon", "src-tauri/icons/app-icon.png"]

[[dev.runners]]
name = "cargo_build"
working_dir = "src-tauri/"
cmd = "cargo"
args = ["build"]

[[dev.runners]]
name = "pcss"
cmd = "npm"
args = ["run", "pcss", "--", "-w"]
concurrent = true 
# if this process exit, end the dev session
end_all_on_exit = true

[[dev.runners]]
name = "rollup"
cmd = "npm"
args = ["run", "rollup", "--", "-w"]
concurrent = true
end_all_on_exit = true

[[dev.runners]]
name = "localhost"
cmd = "npm"
args = ["run", "localhost"]
concurrent = true
end_all_on_exit = true

[[dev.runners]]
name = "tauri_dev"
wait_before = 2000 # wait in ms, before getting called
cmd = "npm"
args = ["run", "tauri", "dev"]
concurrent = true
end_all_on_exit = true
koakh commented 1 year ago

Hello thanks for the fast reply

what i do is

# clone the project and
$ awesome-app dev

full outcome

awesome-app dev

=== Installing node packages
> executing: npm install
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'pcss-cli@0.2.8',
npm WARN EBADENGINE   required: { node: '>=18.0.0' },
npm WARN EBADENGINE   current: { node: 'v16.18.0', npm: '8.5.4' }
npm WARN EBADENGINE }

up to date, audited 121 packages in 769ms

39 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

=== Build src-tauri
> executing: cargo build
   Compiling app v0.1.0 (/mnt/storage/Development/SurrealDb/@ShowCase/RustTauriAwesomeAppWithSurrealDB/src-tauri)
error: proc macro panicked
  --> src/main.rs:47:8
   |
47 |         .run(tauri::generate_context!())
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: message: failed to read icon /mnt/storage/Development/SurrealDb/@ShowCase/RustTauriAwesomeAppWithSurrealDB/src-tauri/icons/32x32.png: No such file or directory (os error 2)

error: could not compile `app` due to previous error
FAIL - Fail to execute cargo cause: 

but after I re-install awesome-app with cargo install awesome-app it show other error

$ awesome-app dev
==== Running runner: npm_install
> executing: npm install
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'pcss-cli@0.2.8',
npm WARN EBADENGINE   required: { node: '>=18.0.0' },
npm WARN EBADENGINE   current: { node: 'v16.18.0', npm: '8.5.4' }
npm WARN EBADENGINE }

up to date, audited 121 packages in 689ms

39 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
==== Running runner: tauri_icons
> executing: npm run tauri icon src-tauri/icons/app-icon.png

> awesome-app-base@0.9.12 tauri
> tauri "icon" "src-tauri/icons/app-icon.png"

error: Found argument '/usr/bin/node16' which wasn't expected, or isn't valid in this context

USAGE:
    cargo-tauri [OPTIONS] <SUBCOMMAND>

For more information try --help
FAIL - Fail to execute npm cause: 

trying....

$ cargo install create-tauri-app

$ node -v
v16.18.0

fixed changing to node v18.9.0

$ node -v
v18.9.0

seems the culprit is the node version, changed node version 18.9.0 and everything start to work has expected and awesome app already running so beautiful and clean, its the first tauri and electron app that don't have the annoying select text like in web page issue this one really smells like native eheheh

thanks @jeremychone

jeremychone commented 1 year ago

Thank you very much for the detailed report.

koakh commented 1 year ago

awesome @jeremychone

$ ls -lah target/release/app
-rwxr-xr-x 2 mario users 20M out 18 22:46 target/release/app

this is crazy man 20mb a app with surreal db embedded hot stuff ahahah

thanks

jeremychone commented 1 year ago

yes, pretty cool. Now, if you add the "file storage" of surrealDB, might be a little bit more, but this is order of magnitude less than what the industry is used to.

Btw, we have done Web UI for a long time, and there are many best practices to make them feel more native. We will share those as we go along. The first tip, is to use the #RealDOM, and keep the DOM tree simple, and use o(1) event binding when possible. Anyway, more to come!

koakh commented 1 year ago

Sure this is only the tip of Iceberg :) I will keep an eye on this project

thanks and keep the awesome work buddy @jeremychone

kind regards