Download src/lib/app-data/server-only.ts from caustino/publish: direct link, hf CLI and curl.
- Browser
- Download file 476 Bytes
-
https://huggingface.co/spaces/caustino/publish/resolve/main/src/lib/app-data/server-only.ts
- Command line
-
hf download hf://spaces/caustino/publish/src/lib/app-data/server-only.ts
-
curl -L -o server-only.ts https://huggingface.co/spaces/caustino/publish/resolve/main/src/lib/app-data/server-only.ts
476 Bytes
| export function assertAppDataServerOnly( | |
| context = "app-data/client.server", | |
| ): void { | |
| if (typeof window !== "undefined") { | |
| throw new Error( | |
| `@/lib/${context} is server-only. Call connector tools from a createServerFn handler (dynamic import of @/lib/app-data/client.server), never from a React component, useEffect, or browser fetch. Types and login helpers are client-safe via @/lib/app-data.`, | |
| ); | |
| } | |
| } | |
| assertAppDataServerOnly("app-data/client.server"); | |