Skip to content
Discussion options

You must be logged in to vote

Right, because you're probably now defining a global that uses surrealdb (only available on ssr) but defining that global in a place that is compiled for both client and server.

Try

#[cfg(feature = "ssr)]
static DB: LazyLock /* etc */;

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@callmeitachi
Comment options

@gbj
Comment options

gbj Aug 4, 2025
Maintainer

Answer selected by callmeitachi
@callmeitachi
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants