dioxus icon indicating copy to clipboard operation
dioxus copied to clipboard

Invalid Cargo.lock format version 4 (nightly toolchain)

Open lucalewin opened this issue 1 year ago • 2 comments

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

lucalewin avatar Oct 18 '24 01:10 lucalewin

I can reproduce.

ThomasCartier avatar Oct 18 '24 16:10 ThomasCartier

Happens here as well.

lotharthesavior avatar Oct 19 '24 01:10 lotharthesavior

I run with 1.81.1 so it is not only nightly.

uzytkownik avatar Oct 20 '24 16:10 uzytkownik

Happens on ubuntu 22.04 and desktop platform as well

fit-sizhe avatar Oct 20 '24 18:10 fit-sizhe

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 avatar Oct 20 '24 18:10 DogeDark

@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.

uzytkownik avatar Oct 22 '24 04:10 uzytkownik

try manually setting the version = 4 to version = 3 in Cargo.lock is useful.

jiangqing03 avatar Nov 15 '24 09:11 jiangqing03