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

Error: navigation was aborted when willingly aborting a navigation #10660

Closed
Smirow opened this issue Aug 31, 2023 · 2 comments · Fixed by #10666
Closed

Error: navigation was aborted when willingly aborting a navigation #10660

Smirow opened this issue Aug 31, 2023 · 2 comments · Fixed by #10666

Comments

@Smirow
Copy link

Smirow commented Aug 31, 2023

Describe the bug

From 1.24.0 Sveltekit throws an uncaught error navigation was aborted whenever the navigation is willingly cancelled by the client. Cancelling the navigation can happen for various valid reasons, throwing an error seems to be unwanted.
Is there anyway to catch the lifecycle error? Would a warning make more sense there?

Reproduction

https://stackblitz.com/edit/sveltejs-kit-template-default-lor1zk

When adding some delay (simulating a long page load) to the "About" page, clicking on "About" and "Home" just after that will trigger an uncaught error:

Enregistrement.de.l.ecran.2023-08-31.a.14.24.23.mov

Logs

No response

System Info

NA

Severity

annoyance

Additional Information

No response

@msf-caesar
Copy link

Try with handling the error by using a try-catch block in the code. Catch the "navigation was aborted" error and handle it appropriately, such as logging a warning instead of throwing an uncaught error.

@Smirow
Copy link
Author

Smirow commented Sep 1, 2023

@msf-caesar as far as I know there is no way to catch a lifecycle error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants