S
SolidJS5mo ago
Hussein

declare types for locals?

i need to declare some locals for RequestEvent
import { User } from "lucia";

declare module "@solidjs/start" {
export interface RequestEventLocals {
user?: User;
}
}
import { User } from "lucia";

declare module "@solidjs/start" {
export interface RequestEventLocals {
user?: User;
}
}
that didn't work
5 Replies
peerreynders
peerreynders5mo ago
- Where did you place this declaration? - How exactly did “that didn't work” manifest itself?
Hussein
Hussein5mo ago
- src/global.d.ts - it didn't show in vscode suggestions in getRequestEvent()?.locals
peerreynders
peerreynders5mo ago
I threw mine into entry-server.tsx and neovim's LSP never complained about it.
GitHub
solid-start-sse-chat/src/entry-server.tsx at d2b9070f956947c940dc20...
Basic Chat demonstration with server-sent events (SSE) - peerreynders/solid-start-sse-chat
Hussein
Hussein5mo ago
oh ok i needed @solidjs/start/server i was using @solidjs/start here ^
peerreynders
peerreynders5mo ago
Details do matter
Want results from more Discord servers?
Add your server