-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix(router-core): handle AbortError in router execution flow #4570
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: leesb971204 <leesb971204@gmail.com>
View your CI Pipeline Execution ↗ for commit e2a8074
☁️ Nx Cloud last updated this comment at |
More templates
@tanstack/arktype-adapter
@tanstack/directive-functions-plugin
@tanstack/eslint-plugin-router
@tanstack/history
@tanstack/react-router
@tanstack/react-router-devtools
@tanstack/react-router-with-query
@tanstack/react-start
@tanstack/react-start-client
@tanstack/react-start-plugin
@tanstack/react-start-server
@tanstack/router-cli
@tanstack/router-core
@tanstack/router-devtools
@tanstack/router-devtools-core
@tanstack/router-generator
@tanstack/router-plugin
@tanstack/router-utils
@tanstack/router-vite-plugin
@tanstack/server-functions-plugin
@tanstack/solid-router
@tanstack/solid-router-devtools
@tanstack/solid-start
@tanstack/solid-start-client
@tanstack/solid-start-plugin
@tanstack/solid-start-server
@tanstack/start-client-core
@tanstack/start-plugin-core
@tanstack/start-server-core
@tanstack/start-server-functions-client
@tanstack/start-server-functions-fetcher
@tanstack/start-server-functions-server
@tanstack/valibot-adapter
@tanstack/virtual-file-routes
@tanstack/zod-adapter
commit: |
if ( | ||
e instanceof DOMException && | ||
e.name === 'AbortError' | ||
) { | ||
const head = await executeHead() | ||
updateMatch(matchId, (prev) => ({ | ||
...prev, | ||
status: | ||
prev.status === 'pending' | ||
? 'success' | ||
: prev.status, | ||
...head, | ||
})) | ||
return | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the documentation, the abortController.abort()
method throws an Error
object of type DOMException
with the name AbortError
.
When this error is thrown during route loading, it is treated as a normal control flow and the route is updated to a valid state accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed you’ve explored similar concerns before(#4531), so I think it would be great to discuss this approach together.
…asepath Signed-off-by: leesb971204 <leesb971204@gmail.com>
Would there be a chance for us to have a conversation about this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about that!
@schiller-manuel there were recent changes this flow if I'm not mistaken with the selective SSR stuff. Would this be an issue?
@leesb971204 provided Manuel's fine with these changes, I don't see a reason not to get this pushed in.
Edit: Also, please make sure that your test are reflected in @tanstack/solid-router
as well.
…asepath Signed-off-by: leesb971204 <leesb971204@gmail.com>
Thanks for the comment! |
Are there any other tasks that need to be completed before this work can be approved? |
Other than the current merge conflict, as mentioned here, I'd like @schiller-manuel to take a look at how this is being handled. |
fixes #4517