denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
93.36k stars 5.18k forks source link

Support Tauri #20738

Open birkskyum opened 9 months ago

birkskyum commented 9 months ago

Tauri - Website - GitHub

Platform

Darwin 23.0.0 arm64 arm

Version

deno 1.37.1

Repro

Expected

I.e. npx tauri dev gives:

➜ npx tauri dev     
     Running BeforeDevCommand (`npm run dev`)

> create-tauri-app@0.0.0 dev
> vite
  VITE v4.4.9  ready in 227 ms

  ➜  Local:   http://localhost:1420/
  ➜  Network: use --host to expose
        Info Watching /Users/admin/repos/tauri-test/create-tauri-app/src-tauri for changes...
   Compiling create-tauri-app v0.0.0 (/Users/admin/repos/tauri-test/create-tauri-app/src-tauri)

    Finished dev [unoptimized + debuginfo] target(s) in 0.68s

Actual

➜ deno run -A npm:tauri dev
error: package 'tauri' did not have a bin property in its package.json
denyncrawford commented 3 months ago

Any update?

ninjadev64 commented 1 month ago

I'm in a Tauri setup with a SvelteKit frontend. Deno is panicking with this backtrace.

============================================================
Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.

Platform: linux x86_64
Version: 1.43.6
Args: ["/home/aman/.deno/bin/deno", "run", "-A", "npm:vite@5.2.11", "dev"]

thread 'main' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/notify-5.0.0/src/inotify.rs:596:32:
called `Result::unwrap()` on an `Err` value: "SendError(..)"
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: <notify::inotify::INotifyWatcher as notify::Watcher>::watch
   4: deno_runtime::ops::fs_events::op_fs_events_open::op_fs_events_open::v8_fn_ptr
   5: Builtins_CallApiCallbackOptimizedNoProfiling
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Deno v1.43.6 Rustc v1.78.0 Tauri v1.6.6 Vite v5.2.11

birkskyum commented 1 month ago

I upgraded to Deno 1.44 to assess if it was feasible for me to use deno for tauri now, because this is one of the tickets relying on binaries and hoped this would help:

this is what I get

➜ DENO_FUTURE=1 deno install npm:tauri
⚠️ `deno install` behavior will change in Deno 2. To preserve the current behavior use the `-g` or `--global` flag.
Add tauri - npm:tauri@^0.15.0
error: Can't set up 'vite' bin at ../.deno/vite@5.2.11/node_modules/vite/bin/vite.js

Caused by:
    File exists (os error 17)

and

➜ DENO_FUTURE=1 deno run npm:tauri dev
error: '/Users/admin/repos/deno-kitchensink/create-tauri-app/node_modules/.deno/tauri@0.15.0/node_modules/tauri/package.json' did not have a bin property
birkskyum commented 5 days ago

With the binary install resolved, this seems to mainly be a matter of confusion/mess with the DENO_FUTURE=1 and the npm:tauri. For instance, the package scripts has an entry called "tauri": "tauri", and it doesn't work well with DENO_FUTURE=1 deno task tauri dev, and DENO_FUTURE=1 deno run npm:tauri.