You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Open or start a project that uses the typed router
Call router.resolve() / router().push() / router().replace() etcetera with { name: 'any-route-that-requires-params' } and omit the params object.
TypeScript does not raise an error.
Expected behavior
TypeScript raises an error, just like it does when providing params but as an empty object, or an object with other properties than the actual required params.
Actual behavior
TypeScript does not show any errors when omitting the params object, when the typed route has required route params. In the runtime, this does result in an error though.
Additional information
Developers use TypeScript to prevent runtime errors. If we fix this, we help preventing runtime errors.
The text was updated successfully, but these errors were encountered:
Reproduction
https://stackblitz.com/edit/github-woay8w-tedisk?file=composables%2FuseSomeRouteComposable.ts
Steps to reproduce the bug
router.resolve()
/router().push()
/router().replace()
etcetera with{ name: 'any-route-that-requires-params' }
and omit theparams
object.Expected behavior
TypeScript raises an error, just like it does when providing
params
but as an empty object, or an object with other properties than the actual required params.Actual behavior
TypeScript does not show any errors when omitting the
params
object, when the typed route has required route params. In the runtime, this does result in an error though.Additional information
Developers use TypeScript to prevent runtime errors. If we fix this, we help preventing runtime errors.
The text was updated successfully, but these errors were encountered: