-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix(router-core,ssr-client): Catch errors thrown during hydrate #5417
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
Closed
Closed
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
44f561c
fix(router-core,ssr-client): catch errors thrown from head
roduyemi b343aaa
chore(e2e): add test case for head not found to solid-start
roduyemi 1c27c12
chore(router-core): remove recursive call when handling before load e…
roduyemi 9729f07
fix(router-core): types in hydrate.test
roduyemi 2b309c5
chore: add eol to hydrate.test
roduyemi 5347508
feat(router-core): move executeHead to beforeLoad
roduyemi 20b60af
chore: execute head functions
roduyemi 1be11a3
Merge remote-tracking branch 'upstream/main' into head-404
roduyemi e53cf57
chore: only run excuteHead during SSR
roduyemi 08c5f8e
fix: remove async on updateContext
roduyemi 7cb7450
chore: execute head after loaders + add test to ensure correct error …
roduyemi 254defe
chore: remove multiple loaders from via-head
roduyemi 3abb562
chore: add via-loaders to test run
roduyemi 5dd98c4
chore: add solid-start e2e via-loaders test
roduyemi fec4a1b
fix: load notFoundComponent with styles during before load error
roduyemi 8238499
chore: remove matchId param from _handleNotFound
roduyemi 366e4af
fix: check match.context before skipping head execution
roduyemi b12398d
chore: rename via-loaders to via-loader-with-context
roduyemi 625c901
fix: update solid-router expected store updates
roduyemi d9b1951
chore: remove thenable
roduyemi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import { createFileRoute, notFound } from '@tanstack/react-router' | ||
|
|
||
| export const Route = createFileRoute('/not-found/via-head')({ | ||
| head: () => { | ||
| throw notFound() | ||
| }, | ||
| component: RouteComponent, | ||
| notFoundComponent: () => { | ||
| return ( | ||
| <div data-testid="via-head-notFound-component"> | ||
| Not Found "/not-found/via-head"! | ||
| </div> | ||
| ) | ||
| }, | ||
| }) | ||
|
|
||
| function RouteComponent() { | ||
| return ( | ||
| <div data-testid="via-head-route-component" data-server={typeof window}> | ||
| Hello "/not-found/via-head"! | ||
| </div> | ||
| ) | ||
| } |
29 changes: 29 additions & 0 deletions
29
e2e/react-start/basic/src/routes/not-found/via-loader-with-context.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| import { createFileRoute, notFound, useRouteContext } from '@tanstack/react-router' | ||
|
|
||
| export const Route = createFileRoute('/not-found/via-loader-with-context')({ | ||
| beforeLoad: () => { | ||
| return { | ||
| fool: 'of a Took' | ||
| } | ||
| }, | ||
| loader: () => { | ||
| throw notFound() | ||
| }, | ||
| component: RouteComponent, | ||
| notFoundComponent: () => { | ||
| const context = useRouteContext({ strict: false }) | ||
| return ( | ||
| <div data-testid="via-loader-with-context-notFound-component" data-server={typeof window}> | ||
| {`Hello you fool ${context.fool}`} | ||
| </div> | ||
| ) | ||
| }, | ||
| }) | ||
|
|
||
| function RouteComponent() { | ||
| return ( | ||
| <div data-testid="via-loader-with-context-route-component" data-server={typeof window}> | ||
| Hello "/not-found/via-loader-with-context"! | ||
| </div> | ||
| ) | ||
| } | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.