specta-rs / tauri-specta

Completely typesafe Tauri commands
MIT License
403 stars 41 forks source link

Version mismatch #102

Closed SSardorf closed 6 months ago

SSardorf commented 6 months ago

In a completely new tauri application with the following cargo file:

[package]
name = "specta_test"
version = "0.0.0"
description = "A Tauri App"
authors = ["you"]
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[build-dependencies]
tauri-build = { version = "2.0.0-beta", features = [] }

[dependencies]
tauri-plugin-shell = "2.0.0-beta"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tauri = { version = "=2.0.0-beta.22", features = [] }
specta = "=2.0.0-rc.12"
tauri-specta = { version = "=2.0.0-rc.5", features = ["javascript", "typescript"] }

I get the following error:

error: failed to select a version for `specta`.
    ... required by package `tauri-specta v2.0.0-rc.5`
    ... which satisfies dependency `tauri-specta = "=2.0.0-rc.5"` of package `specta_test v0.0.0 (/Users/ssardorf/dev/rust/tauri_projects/specta_test/src-tauri)`
versions that meet the requirements `=2.0.0-rc.11` are: 2.0.0-rc.11

all possible versions conflict with previously selected packages.

  previously selected package `specta v2.0.0-rc.12`
    ... which satisfies dependency `specta = "=2.0.0-rc.12"` of package `specta_test v0.0.0 (/Users/ssardorf/dev/rust/tauri_projects/specta_test/src-tauri)`

failed to select a version for `specta` which could resolve this conflict
SSardorf commented 6 months ago

Removing the = from the specta and tauri versions fixes the issue for me.

Brendonovich commented 6 months ago

The latest version of tauri-specta is 2.0.0-rc.11 which should be used with specta 2.0.0-rc.12, like in this example.

SSardorf commented 6 months ago

The latest version of tauri-specta is 2.0.0-rc.11 which should be used with specta 2.0.0-rc.12, like in this example.

Appreciate your response. I just followed the v2 readme image

Brendonovich commented 6 months ago

Ah yep, will get that updated

oscartbeaumont commented 6 months ago

Whoops completely forgot to update it when releasing Tauri Specta.

I would also recommend keeping the = in case Tauri do any breaking changes which is why we show it in the docs.