Hi, I'm trying spawn an async task in a Startup system using
tokio::spawn(async move { ... })
but I'm getting the error:
there is no reactor running, must be called from the context of a Tokio 1.x runtime
My main is annotated:
#[tokio::main]
async fn main() { ... }
I read on Reddit that it could be an issue with different Tokio versions, but my cargo tree looks fine(?):
cargo tree | grep tokio
│ ├── tokio v1.35.1
│ │ └── tokio-macros v2.2.0 (proc-macro)
│ │ ├── tokio v1.35.1 (*)
│ ├── tokio v1.35.1 (*)
│ ├── tokio v1.35.1 (*)
│ ├── tokio-tungstenite v0.21.0
│ │ ├── tokio v1.35.1 (*)
├── tokio v1.35.1 (*)
├── tokio-tungstenite v0.21.0 (*)
├── tokio-tungstenite-wasm v0.2.1
│ ├── tokio v1.35.1 (*)
│ └── tokio-tungstenite v0.20.1
│ ├── tokio v1.35.1 (*)
I imagine it's something very simple but I'm not even sure where to begin.