Invalid Cargo.lock format version 4 (nightly toolchain)
Problem
(This is when using the nightly toolchain, with the current 1.81.0 version this error does not occur, but in the future with 1.84.0 this could maybe happen)
When using dx serve, after Build done. I get this error:
thread 'main' panicked at /home/lucalewin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/manganis-cli-support-0.2.4/src/manifest.rs:51:51:
called `Result::unwrap()` on an `Err` value: Parse("parse error: invalid Cargo.lock format version: `4`\n")
These are the first lines in the Cargo.lock:
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
Steps To Reproduce
dx init with router and tailwind
Expected behavior
There should not be an error
Environment:
dioxus 0.5.7
cargo 1.84.0-nightly (15fbd2f60 2024-10-08)
- OS info:
Ubutu 24.10 - App platform:
web
I can reproduce.
Happens here as well.
I run with 1.81.1 so it is not only nightly.
Happens on ubuntu 22.04 and desktop platform as well
For a potential solution in the meantime, try manually setting the version = 4 to version = 3 in your Cargo.lock. (Someone said it worked for them in #3034)
I will be closing this issue in favor of #3034
@DogeDark I tried that before following up this issue. For 1.81 and nightlies it did not worked for me. Something in dx (probably invocation of cargo) updated it to version = 4.
try manually setting the version = 4 to version = 3 in Cargo.lock is useful.