error[E0432]: unresolved import `actix_web_lab::web::spa`
--> backend/src/main.rs:14:5
|
14 | use actix_web_lab::web::spa;
| ^^^^^^^^^^^^^^^^^^^^^^^ no `spa` in `web`
For more information about this error, try `rustc --explain E0432`.
error: could not compile `backend` (bin "backend") due to previous error
已经在目录中尝试过这个,但仍然不起作用
cargo add actix-web-lab
Or add the following line to your Cargo.toml:
actix-web-lab = "0.19.1"
spa()
上的文档明确指出:
仅在 crate 功能
上可用。spa
所以您需要启用此功能。例如。与
cargo add
:
cargo add actix-web-lab --features spa
或者通过更改 Cargo.toml:
actix-web-lab = { version = "0.19.1", features = ["spa"] }