question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

router typescript error

See original GitHub issue

Which @angular/* package(s) are the source of the bug?

router

Is this a regression?

No

Description

After upgrading Angular app from 12.2.9 to 13.2.0

Trying to build/serve the app gives a typescript validation error.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

Error: node_modules/@angular/router/router.d.ts:652:6 - error TS1023: An index signature parameter type must be either 'string' or 'number'.

652     [key: string | symbol]: any;
         ~~~


Error: node_modules/@angular/router/router.d.ts:1626:6 - error TS1023: An index signature parameter type must be either 'string' or 'number'.

1626     [key: string | symbol]: any;
          ~~~

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 13.1.4
Node: 16.12.0
Package Manager: npm 8.1.0
OS: win32 x64

Angular: 13.2.0
... animations, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.1202.15
@angular-devkit/build-angular     13.1.4
@angular-devkit/build-optimizer   0.1202.15
@angular-devkit/core              12.2.9
@angular-devkit/schematics        12.2.9
@angular/cli                      13.1.4
@schematics/angular               12.2.9
rxjs                              6.6.7
typescript                        4.5.5

Anything else?

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
Coder7777commented, Feb 16, 2022

I change router.d.ts definition

image

It looks like work well temporary.

1reaction
krskrscommented, Feb 7, 2022

Thank you guys, this helped me as well!

Read more comments on GitHub >

github_iconTop Results From Across the Web

React router in typescript giving errors - Stack Overflow
When I try to compile my code and execute using gulp serve --nobrowser I get below errors. [16:49:52] Error - [tsc] node_modules/@types/react- ...
Read more >
Issues in react-router when import any component in my react ...
After that, the console writes about these errors due to an importing BrowserRouter: [17:09:10] Error - [tsc] node_modules/react-router/index.d.
Read more >
[Solved]-react-router Link typescript error-Reactjs
Version 4 of react-router moved a lot of the library into the react-router-dom package, which is why their types are not in the...
Read more >
isRouteErrorResponse v6.6.1 - React Router
This returns true if a route error is a route error response. ... If the user visits a route that does not match...
Read more >
How to Handle Errors in Express with TypeScript
Catching Errors. To handle errors, you first must catch them. You could program the best error handler, but it wouldn't matter if some...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found