How to define a static variable and use it elsewhere?" #4205
-
Hi, I've been trying to build a website using Rust's Leptos framework with SurrealDB, but I've encountered an issue. I defined a global DB variable but can't use it elsewhere. How can I solve this problem? Here's how I defined my DB variable:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
No, you defined a |
Beta Was this translation helpful? Give feedback.
Right, because you're probably now defining a global that uses
surrealdb
(only available onssr
) but defining that global in a place that is compiled for both client and server.Try