Route snapshots are typed as non-optional, but we found a situation where it was undefined. Looking at the Angular source code, it seems like indeed snapshots can be undefined but they have been declared with a definite assignment assertion: https://github.com/angular/angular/blob/17.3.0/packages/router/src/router_state.ts#L231