Describe the bug
In RouteParams, optional route parameters are typed as { param?: string }. This does not work well when using exactOptionalPropertyTypes, since TypeScript will yell if you pass in undefined:
The solution is to type optional parameters as { param?: string | undefined }.
Reproduction
Create a SvelteKit app with a route with an optional route parameter. Use the resolve function and try passing in undefined to the route parameter.
Logs
System Info
Severity
annoyance
Additional Information
No response
Describe the bug
In
RouteParams, optional route parameters are typed as{ param?: string }. This does not work well when usingexactOptionalPropertyTypes, since TypeScript will yell if you pass inundefined:The solution is to type optional parameters as
{ param?: string | undefined }.Reproduction
Create a SvelteKit app with a route with an optional route parameter. Use the
resolvefunction and try passing inundefinedto the route parameter.Logs
System Info
Severity
annoyance
Additional Information
No response