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

Cargo install cargo-leptos fails #419

Open
BraveMole opened this issue Jan 20, 2025 · 4 comments · May be fixed by #420
Open

Cargo install cargo-leptos fails #419

BraveMole opened this issue Jan 20, 2025 · 4 comments · May be fixed by #420

Comments

@BraveMole
Copy link

Cargo install cargo-leptos fails with the following error:

unresolved imports `swc_ecma_ast::fast_id`, `swc_ecma_ast::FastId`
 --> /home/bsouchu/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/swc_ecma_utils-6.0.1/src/ident.rs:3:20
  |
3 | use swc_ecma_ast::{fast_id, BindingIdent, FastId, Id, Ident};

Looks like swc has been recently updated and that is what is causing the error. In my compilation, swc v9.0.2 was used.

Note: cloned cargo leptos and built it, absolutly no problem. It only happens with cargo install

@BraveMole
Copy link
Author

When building locally, swc_ecma_ast v5.0.1 is used --> no problem

when using cargo install, swc_ecma_ast v5.0.2 is used --> compilation issue

@BraveMole
Copy link
Author

Posted an issue on SWC : swc-project/swc#9906

@eagleflo
Copy link
Contributor

swc moves pretty fast and is unlikely to fix issues with old versions; Donny has already closed the linked issue. I tried bumping swc to 10.0 and it seems to build & work fine.

@blopker
Copy link

blopker commented Jan 22, 2025

For anyone who just ran into this and wants a quick fix, use --locked:

cargo install cargo-leptos --locked

This uses the published Cargo.lock file instead of randomly updating dependencies. Maybe this should be mentioned on https://book.leptos.dev/ssr/21_cargo_leptos.html?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants