How to use spa from actix_web_lab? It doesn't seem to exist

118 Views Asked by At
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

I already tried this in directory but still did not work:

cargo add actix-web-lab

Or add the following line to your Cargo.toml:

actix-web-lab = "0.19.1"
1

There are 1 best solutions below

0
On

The docs on spa() clearly state:

Available on crate feature spa only.

So you need to enable this feature. E.g. with cargo add:

cargo add actix-web-lab --features spa

Or by changing Cargo.toml:

actix-web-lab = { version = "0.19.1", features = ["spa"] }