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] yarn tauri dev window crashes and restart with no any error message printed. #5417

Closed
Tnze opened this issue Oct 17, 2022 · 7 comments
Closed
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@Tnze
Copy link
Contributor

Tnze commented Oct 17, 2022

Describe the bug

  1. When using yarn tauri dev, the window closes after executing a tauri::command and automatically reopen. With no any panic message.
  2. When yarn build and then using cargo run, the program works just fine, no any error occurs. Which is wired.

I guess this is a bug of @tauri/cli.

Reproduction

  1. git clone https://github.com/Tnze/ffxiv-best-craft.git
  2. git checkout e804ed40496595fb3143f38bf641b2f62c15dc07
  3. yarn install
  4. yarn tauri dev
  5. Click the second button
    image

Expected behavior

Expecte the cli doesn't close and reopen my window.

Platform and versions

yarn-run-tauri 1.1.1
   Node.js: 18.10.0
   npm: 8.19.2
   pnpm: Not installed!
   yarn: 3.2.1
   rustup: 1.25.1
   rustc: 1.66.0-nightly
   cargo: 1.66.0-nightly
   Rust toolchain: nightly-x86_64-pc-windows-msvc

Packages
   @tauri-apps/cli [NPM]: 1.1.1
   @tauri-apps/api [NPM]: 1.1.0
   tauri [RUST]: 1.1.1,
   tauri-build [RUST]: 1.1.1,
   tao [RUST]: 0.14.0,
   wry [RUST]: 0.21.1,

App
   build-type: bundle
   CSP: unset
   distDir: ../dist
   devPath: http://localhost:5173/
   framework: Vue.js

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

Stack trace

DOESN'T EXIST

Additional context

The tauri::command executed is this one:

https://github.com/Tnze/ffxiv-best-craft/blob/e804ed40496595fb3143f38bf641b2f62c15dc07/src-tauri/src/main.rs#L107-L111

The defining of app_state is tauri::State<'_, AppState> which has to write a '_ lifetime for pass the compiling. That is different from other commands. Is that expected?

@Tnze Tnze added status: needs triage This issue needs to triage, applied to new issues type: bug labels Oct 17, 2022
@FabianLars
Copy link
Sponsor Member

The file watcher watches the whole src-tauri dir so i guess the changes to the db file triggers it. You could try adding a .taurignore file next to tauri.conf.json where you ignore the assets folder 🤔

@Tnze
Copy link
Contributor Author

Tnze commented Oct 17, 2022

I connect the db file in read-only mode: sqlite:./assets/xiv.db?mode=ro. Is sqlite still writing that file?

@Tnze

This comment was marked as resolved.

@Tnze
Copy link
Contributor Author

Tnze commented Oct 17, 2022

Adding the .taurignore file fixes the problem.

assets/

But is it possible to only ignore the single .db file?

@FabianLars
Copy link
Sponsor Member

I connect the db file in read-only mode: sqlite:./assets/xiv.db?mode=ro. Is sqlite still writing that file?

Not sure how sqlite databases work, maybe it still creates a lockfile or something?

But is it possible to only ignore the single .db file?

If assets/ works /assets/dbname.db or /assets/*.db should work too, if the .db file is the problem

@Tnze
Copy link
Contributor Author

Tnze commented Oct 17, 2022

Thank you, I think we absolutely need to let cli print some information when detecting file changes. It's so wired.

@Tnze
Copy link
Contributor Author

Tnze commented Oct 18, 2022

By using #5428, I find out the changed file is

        Info File C:\....\ffxiv-crafting-assistant\src-tauri\assets\xiv.db-shm changed!

But for .taurignore file, assets/, /assets/ works, but assets/*, /assets/*, /assets/xiv.db-shm doesn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

2 participants