Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 1 commit into from

Conversation

alan-agius4
Copy link
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
…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
@@ -58,13 +58,6 @@ export function canLoadFails(route: Route): Observable<LoadedRouterConfig> {
export class ApplyRedirects {
constructor(private urlSerializer: UrlSerializer, private urlTree: UrlTree) {}

noMatchError(e: NoMatch): any {
Copy link
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
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

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
danieljancar pushed a commit to danieljancar/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