Skip to content

fix(router): provide more actionable error message when route is not matched in production mode#53523

Closed
alan-agius4 wants to merge 1 commit intoangular:mainfrom
alan-agius4:error-route-not-found
Closed

fix(router): provide more actionable error message when route is not matched in production mode#53523
alan-agius4 wants to merge 1 commit intoangular:mainfrom
alan-agius4:error-route-not-found

Conversation

@alan-agius4
Copy link
Copy Markdown
Contributor

Prior to this commit when a route is not matched and the application was running in production mode an [Error]: NG04002 was logged in the console. This however, is not actionable when the application is running on the server where there can be multiple pages being rendered at the same time.

Now we change this to also log the route example: [Error]: NG04002: 'products/Jeep'.

Closes #53522

@alan-agius4 alan-agius4 added action: review The PR is still awaiting reviews from at least one requested reviewer hotlist: error messages area: router target: patch This PR is targeted for the next patch release labels Dec 12, 2023
@ngbot ngbot bot added this to the Backlog milestone Dec 12, 2023
@alan-agius4 alan-agius4 marked this pull request as ready for review December 12, 2023 15:47
@pullapprove pullapprove bot requested a review from AndrewKushnir December 12, 2023 15:47
@alan-agius4 alan-agius4 force-pushed the error-route-not-found branch from 5dbb106 to c3fe3ec Compare December 12, 2023 15:48
…matched in production mode

Prior to this commit when a route is not matched and the application was running in production mode an `[Error]: NG04002` was logged in the console. This however, is not actionable when the application is running on the server where there can be multiple pages being rendered at the same time.

Now we change this to also log the route example: `[Error]: NG04002: 'products/Jeep'`.

Closes angular#53522
@alan-agius4 alan-agius4 force-pushed the error-route-not-found branch from c3fe3ec to c5fa9fd Compare December 12, 2023 15:51
export class ApplyRedirects {
constructor(private urlSerializer: UrlSerializer, private urlTree: UrlTree) {}

noMatchError(e: NoMatch): any {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was unused.

@AndrewKushnir AndrewKushnir removed the action: review The PR is still awaiting reviews from at least one requested reviewer label Dec 12, 2023
@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label Dec 12, 2023
@alxhub
Copy link
Copy Markdown
Member

alxhub commented Dec 12, 2023

This PR was merged into the repository by commit 48c5041.

alxhub pushed a commit that referenced this pull request Dec 12, 2023
…matched in production mode (#53523)

Prior to this commit when a route is not matched and the application was running in production mode an `[Error]: NG04002` was logged in the console. This however, is not actionable when the application is running on the server where there can be multiple pages being rendered at the same time.

Now we change this to also log the route example: `[Error]: NG04002: 'products/Jeep'`.

Closes #53522

PR Close #53523
@alxhub alxhub closed this in 48c5041 Dec 12, 2023
@alan-agius4 alan-agius4 deleted the error-route-not-found branch December 13, 2023 06:23
@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jan 13, 2024
ChellappanRajan pushed a commit to ChellappanRajan/angular that referenced this pull request Jan 23, 2024
…matched in production mode (angular#53523)

Prior to this commit when a route is not matched and the application was running in production mode an `[Error]: NG04002` was logged in the console. This however, is not actionable when the application is running on the server where there can be multiple pages being rendered at the same time.

Now we change this to also log the route example: `[Error]: NG04002: 'products/Jeep'`.

Closes angular#53522

PR Close angular#53523
rlmestre pushed a commit to rlmestre/angular that referenced this pull request Jan 26, 2024
…matched in production mode (angular#53523)

Prior to this commit when a route is not matched and the application was running in production mode an `[Error]: NG04002` was logged in the console. This however, is not actionable when the application is running on the server where there can be multiple pages being rendered at the same time.

Now we change this to also log the route example: `[Error]: NG04002: 'products/Jeep'`.

Closes angular#53522

PR Close angular#53523
amilamen pushed a commit to amilamen/angular that referenced this pull request Jan 26, 2024
…matched in production mode (angular#53523)

Prior to this commit when a route is not matched and the application was running in production mode an `[Error]: NG04002` was logged in the console. This however, is not actionable when the application is running on the server where there can be multiple pages being rendered at the same time.

Now we change this to also log the route example: `[Error]: NG04002: 'products/Jeep'`.

Closes angular#53522

PR Close angular#53523
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: router hotlist: error messages target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warn when SSR text file routes don't match the configured routes

3 participants