Closed
Description
Duplicates
- I have searched the existing issues
Latest version
- I have tested the latest version
Current behavior 😯
The example in the documentation doesn't seam to work.
declare module "@solidjs/start/server" {
interface RequestEventLocals {
myNumber: number;
someString: string;
}
}
locals
property within the RequestEvent doesn't have any types declared in global.d.ts. For example in one of the routes:
import { getRequestEvent } from 'solid-js/web'
const getMessage = cache(async () => {
'use server'
const event = getRequestEvent()
// event?.locals is not typed
return
}, 'message')
export const route = {
load: () => getMessage(),
}
and my global.d.ts has
declare module '@solidjs/start/server' {
interface RequestEventLocals {
myNumber: number
someString: string
}
}
Expected behavior 🤔
No response
Steps to reproduce 🕹
Steps:
- Create an solid-start app using one of the templates
- Declare '@solidjs/start/server' within the global.d.ts file
- Try accessing
event.locals.<SOMETHING>
within a route function
Context 🔦
No response
Your environment 🌎
No response