@tanstack/solid-router 1.168.8 → 1.168.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -78,7 +78,11 @@ var Match = (props) => {
78
78
  return routeErrorComponent() || require_CatchBoundary.ErrorComponent;
79
79
  },
80
80
  onCatch: (error) => {
81
- if ((0, _tanstack_router_core.isNotFound)(error)) throw error;
81
+ const notFoundError = require_not_found.getNotFound(error);
82
+ if (notFoundError) {
83
+ notFoundError.routeId ??= currentMatchState().routeId;
84
+ throw notFoundError;
85
+ }
82
86
  if (process.env.NODE_ENV !== "production") console.warn(`Warning: Error in route match: ${currentMatchState().routeId}`);
83
87
  routeOnCatch()?.(error);
84
88
  },
@@ -88,10 +92,12 @@ var Match = (props) => {
88
92
  return ResolvedNotFoundBoundary();
89
93
  },
90
94
  fallback: (error) => {
91
- if (!routeNotFoundComponent() || error.routeId && error.routeId !== currentMatchState().routeId || !error.routeId && !route().isRoot) throw error;
95
+ const notFoundError = require_not_found.getNotFound(error) ?? error;
96
+ notFoundError.routeId ??= currentMatchState().routeId;
97
+ if (!routeNotFoundComponent() || notFoundError.routeId && notFoundError.routeId !== currentMatchState().routeId || !notFoundError.routeId && !route().isRoot) throw notFoundError;
92
98
  return (0, solid_js_web.createComponent)(solid_js_web.Dynamic, (0, solid_js_web.mergeProps)({ get component() {
93
99
  return routeNotFoundComponent();
94
- } }, error));
100
+ } }, notFoundError));
95
101
  },
96
102
  get children() {
97
103
  return (0, solid_js_web.createComponent)(solid_js.Switch, { get children() {
@@ -1 +1 @@
1
- {"version":3,"file":"Match.cjs","names":["Solid","createControlledPromise","getLocationChangeInfo","invariant","isNotFound","isRedirect","rootRouteId","isServer","Dynamic","CatchBoundary","ErrorComponent","useRouter","CatchNotFound","nearestMatchContext","SafeFragment","renderRouteNotFound","ScrollRestoration","AnyRoute","RootRouteOptions","Match","props","matchId","router","match","createMemo","id","undefined","stores","activeMatchStoresById","get","state","rawMatchState","currentMatch","routeId","parentRouteId","routesById","parentRoute","ssr","_displayPending","hasPendingMatch","currentRouteId","Boolean","pendingRouteIds","nearestMatch","hasPending","_$createComponent","Show","when","children","currentMatchState","route","resolvePendingComponent","options","pendingComponent","defaultPendingComponent","routeErrorComponent","errorComponent","defaultErrorComponent","routeOnCatch","onCatch","defaultOnCatch","routeNotFoundComponent","isRoot","notFoundComponent","notFoundRoute","component","resolvedNoSsr","ResolvedSuspenseBoundary","Suspense","ResolvedCatchBoundary","ResolvedNotFoundBoundary","ShellComponent","shellComponent","Provider","value","fallback","_$memo","getResetKey","loadedAt","error","Error","process","env","NODE_ENV","console","warn","_$mergeProps","Switch","MatchInner","OnRendered","scrollRestoration","location","resolvedLocation","__TSR_key","createEffect","on","emit","type","useContext","remountFn","remountDeps","defaultRemountDeps","loaderDeps","params","_strictParams","search","_strictSearch","key","JSON","stringify","status","_forcePending","componentKey","out","Comp","defaultComponent","Outlet","keyedOut","keyed","_key","_","displayPendingResult","createResource","getMatch","_nonReactive","displayPendingPromise","minPendingResult","minPendingPromise","pendingMinMs","defaultPendingMinMs","routerMatch","setTimeout","resolve","loaderResult","Promise","r","loadPromise","FallbackComponent","_routeId","RouteErrorComponent","info","componentStack","nearestParentMatch","parentMatch","parentGlobalNotFound","globalNotFound","childMatchId","childMatchIdByRouteId","childMatchStatus","shouldShowNotFound","resolvedRoute","childMatchIdAccessor","currentMatchId"],"sources":["../../src/Match.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport {\n createControlledPromise,\n getLocationChangeInfo,\n invariant,\n isNotFound,\n isRedirect,\n rootRouteId,\n} from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { Dynamic } from 'solid-js/web'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport { CatchNotFound } from './not-found'\nimport { nearestMatchContext } from './matchContext'\nimport { SafeFragment } from './SafeFragment'\nimport { renderRouteNotFound } from './renderRouteNotFound'\nimport { ScrollRestoration } from './scroll-restoration'\nimport type { AnyRoute, RootRouteOptions } from '@tanstack/router-core'\n\nexport const Match = (props: { matchId: string }) => {\n const router = useRouter()\n\n const match = Solid.createMemo(() => {\n const id = props.matchId\n if (!id) return undefined\n return router.stores.activeMatchStoresById.get(id)?.state\n })\n\n const rawMatchState = Solid.createMemo(() => {\n const currentMatch = match()\n if (!currentMatch) {\n return null\n }\n\n const routeId = currentMatch.routeId as string\n const parentRouteId = (router.routesById[routeId] as AnyRoute)?.parentRoute\n ?.id\n\n return {\n matchId: currentMatch.id,\n routeId,\n ssr: currentMatch.ssr,\n _displayPending: currentMatch._displayPending,\n parentRouteId: parentRouteId as string | undefined,\n }\n })\n\n const hasPendingMatch = Solid.createMemo(() => {\n const currentRouteId = rawMatchState()?.routeId\n return currentRouteId\n ? Boolean(router.stores.pendingRouteIds.state[currentRouteId])\n : false\n })\n const nearestMatch = {\n matchId: () => rawMatchState()?.matchId,\n routeId: () => rawMatchState()?.routeId,\n match,\n hasPending: hasPendingMatch,\n }\n\n return (\n <Solid.Show when={rawMatchState()}>\n {(currentMatchState) => {\n const route: () => AnyRoute = () =>\n router.routesById[currentMatchState().routeId]\n\n const resolvePendingComponent = () =>\n route().options.pendingComponent ??\n router.options.defaultPendingComponent\n\n const routeErrorComponent = () =>\n route().options.errorComponent ?? router.options.defaultErrorComponent\n\n const routeOnCatch = () =>\n route().options.onCatch ?? router.options.defaultOnCatch\n\n const routeNotFoundComponent = () =>\n route().isRoot\n ? // If it's the root route, use the globalNotFound option, with fallback to the notFoundRoute's component\n (route().options.notFoundComponent ??\n router.options.notFoundRoute?.options.component)\n : route().options.notFoundComponent\n\n const resolvedNoSsr =\n currentMatchState().ssr === false ||\n currentMatchState().ssr === 'data-only'\n\n const ResolvedSuspenseBoundary = () => Solid.Suspense\n\n const ResolvedCatchBoundary = () =>\n routeErrorComponent() ? CatchBoundary : SafeFragment\n\n const ResolvedNotFoundBoundary = () =>\n routeNotFoundComponent() ? CatchNotFound : SafeFragment\n\n const ShellComponent = route().isRoot\n ? ((route().options as RootRouteOptions).shellComponent ??\n SafeFragment)\n : SafeFragment\n\n return (\n <ShellComponent>\n <nearestMatchContext.Provider value={nearestMatch}>\n <Dynamic\n component={ResolvedSuspenseBoundary()}\n fallback={\n // Don't show fallback on server when using no-ssr mode to avoid hydration mismatch\n (isServer ?? router.isServer) && resolvedNoSsr ? undefined : (\n <Dynamic component={resolvePendingComponent()} />\n )\n }\n >\n <Dynamic\n component={ResolvedCatchBoundary()}\n getResetKey={() => router.stores.loadedAt.state}\n errorComponent={routeErrorComponent() || ErrorComponent}\n onCatch={(error: Error) => {\n // Forward not found errors (we don't want to show the error component for these)\n if (isNotFound(error)) throw error\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `Warning: Error in route match: ${currentMatchState().routeId}`,\n )\n }\n routeOnCatch()?.(error)\n }}\n >\n <Dynamic\n component={ResolvedNotFoundBoundary()}\n fallback={(error: any) => {\n // If the current not found handler doesn't exist or it has a\n // route ID which doesn't match the current route, rethrow the error\n if (\n !routeNotFoundComponent() ||\n (error.routeId &&\n error.routeId !== currentMatchState().routeId) ||\n (!error.routeId && !route().isRoot)\n )\n throw error\n\n return (\n <Dynamic\n component={routeNotFoundComponent()}\n {...error}\n />\n )\n }}\n >\n <Solid.Switch>\n <Solid.Match when={resolvedNoSsr}>\n <Solid.Show\n when={!(isServer ?? router.isServer)}\n fallback={\n <Dynamic component={resolvePendingComponent()} />\n }\n >\n <MatchInner />\n </Solid.Show>\n </Solid.Match>\n <Solid.Match when={!resolvedNoSsr}>\n <MatchInner />\n </Solid.Match>\n </Solid.Switch>\n </Dynamic>\n </Dynamic>\n </Dynamic>\n </nearestMatchContext.Provider>\n\n {currentMatchState().parentRouteId === rootRouteId ? (\n <>\n <OnRendered />\n {router.options.scrollRestoration &&\n (isServer ?? router.isServer) ? (\n <ScrollRestoration />\n ) : null}\n </>\n ) : null}\n </ShellComponent>\n )\n }}\n </Solid.Show>\n )\n}\n\n// On Rendered can't happen above the root layout because it needs to run\n// after the app has committed below the root layout. Keeping it here lets us\n// fire onRendered even after a hydration mismatch above the root layout\n// (like bad head/link tags, which is common).\nfunction OnRendered() {\n const router = useRouter()\n\n const location = Solid.createMemo(\n () => router.stores.resolvedLocation.state?.state.__TSR_key,\n )\n Solid.createEffect(\n Solid.on([location], () => {\n router.emit({\n type: 'onRendered',\n ...getLocationChangeInfo(\n router.stores.location.state,\n router.stores.resolvedLocation.state,\n ),\n })\n }),\n )\n return null\n}\n\nexport const MatchInner = (): any => {\n const router = useRouter()\n const match = Solid.useContext(nearestMatchContext).match\n\n const rawMatchState = Solid.createMemo(() => {\n const currentMatch = match()\n if (!currentMatch) {\n return null\n }\n\n const routeId = currentMatch.routeId as string\n\n const remountFn =\n (router.routesById[routeId] as AnyRoute).options.remountDeps ??\n router.options.defaultRemountDeps\n const remountDeps = remountFn?.({\n routeId,\n loaderDeps: currentMatch.loaderDeps,\n params: currentMatch._strictParams,\n search: currentMatch._strictSearch,\n })\n const key = remountDeps ? JSON.stringify(remountDeps) : undefined\n\n return {\n key,\n routeId,\n match: {\n id: currentMatch.id,\n status: currentMatch.status,\n error: currentMatch.error,\n _forcePending: currentMatch._forcePending ?? false,\n _displayPending: currentMatch._displayPending ?? false,\n },\n }\n })\n\n return (\n <Solid.Show when={rawMatchState()}>\n {(currentMatchState) => {\n const route = () => router.routesById[currentMatchState().routeId]!\n\n const currentMatch = () => currentMatchState().match\n\n const componentKey = () =>\n currentMatchState().key ?? currentMatchState().match.id\n\n const out = () => {\n const Comp =\n route().options.component ?? router.options.defaultComponent\n if (Comp) {\n return <Comp />\n }\n return <Outlet />\n }\n\n const keyedOut = () => (\n <Solid.Show when={componentKey()} keyed>\n {(_key) => out()}\n </Solid.Show>\n )\n\n return (\n <Solid.Switch>\n <Solid.Match when={currentMatch()._displayPending}>\n {(_) => {\n const [displayPendingResult] = Solid.createResource(\n () =>\n router.getMatch(currentMatch().id)?._nonReactive\n .displayPendingPromise,\n )\n\n return <>{displayPendingResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch()._forcePending}>\n {(_) => {\n const [minPendingResult] = Solid.createResource(\n () =>\n router.getMatch(currentMatch().id)?._nonReactive\n .minPendingPromise,\n )\n\n return <>{minPendingResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'pending'}>\n {(_) => {\n const pendingMinMs =\n route().options.pendingMinMs ??\n router.options.defaultPendingMinMs\n\n if (pendingMinMs) {\n const routerMatch = router.getMatch(currentMatch().id)\n if (\n routerMatch &&\n !routerMatch._nonReactive.minPendingPromise\n ) {\n // Create a promise that will resolve after the minPendingMs\n if (!(isServer ?? router.isServer)) {\n const minPendingPromise = createControlledPromise<void>()\n\n routerMatch._nonReactive.minPendingPromise =\n minPendingPromise\n\n setTimeout(() => {\n minPendingPromise.resolve()\n // We've handled the minPendingPromise, so we can delete it\n routerMatch._nonReactive.minPendingPromise = undefined\n }, pendingMinMs)\n }\n }\n }\n\n const [loaderResult] = Solid.createResource(async () => {\n await new Promise((r) => setTimeout(r, 0))\n return router.getMatch(currentMatch().id)?._nonReactive\n .loadPromise\n })\n\n const FallbackComponent =\n route().options.pendingComponent ??\n router.options.defaultPendingComponent\n\n return (\n <>\n {FallbackComponent && pendingMinMs > 0 ? (\n <Dynamic component={FallbackComponent} />\n ) : null}\n {loaderResult()}\n </>\n )\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'notFound'}>\n {(_) => {\n if (!isNotFound(currentMatch().error)) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n 'Invariant failed: Expected a notFound error',\n )\n }\n\n invariant()\n }\n\n // Use Show with keyed to ensure re-render when routeId changes\n return (\n <Solid.Show when={currentMatchState().routeId} keyed>\n {(_routeId) =>\n renderRouteNotFound(router, route(), currentMatch().error)\n }\n </Solid.Show>\n )\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'redirected'}>\n {(_) => {\n if (!isRedirect(currentMatch().error)) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n 'Invariant failed: Expected a redirect error',\n )\n }\n\n invariant()\n }\n\n const [loaderResult] = Solid.createResource(async () => {\n await new Promise((r) => setTimeout(r, 0))\n return router.getMatch(currentMatch().id)?._nonReactive\n .loadPromise\n })\n\n return <>{loaderResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'error'}>\n {(_) => {\n if (isServer ?? router.isServer) {\n const RouteErrorComponent =\n (route().options.errorComponent ??\n router.options.defaultErrorComponent) ||\n ErrorComponent\n\n return (\n <RouteErrorComponent\n error={currentMatch().error}\n info={{\n componentStack: '',\n }}\n />\n )\n }\n\n throw currentMatch().error\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'success'}>\n {keyedOut()}\n </Solid.Match>\n </Solid.Switch>\n )\n }}\n </Solid.Show>\n )\n}\n\nexport const Outlet = () => {\n const router = useRouter()\n const nearestParentMatch = Solid.useContext(nearestMatchContext)\n const parentMatch = nearestParentMatch.match\n const routeId = nearestParentMatch.routeId\n const route = Solid.createMemo(() =>\n routeId() ? router.routesById[routeId()!] : undefined,\n )\n\n const parentGlobalNotFound = Solid.createMemo(\n () => parentMatch()?.globalNotFound ?? false,\n )\n\n const childMatchId = Solid.createMemo(() => {\n const currentRouteId = routeId()\n return currentRouteId\n ? router.stores.childMatchIdByRouteId.state[currentRouteId]\n : undefined\n })\n\n const childMatchStatus = Solid.createMemo(() => {\n const id = childMatchId()\n if (!id) return undefined\n return router.stores.activeMatchStoresById.get(id)?.state.status\n })\n\n // Only show not-found if we're not in a redirected state\n const shouldShowNotFound = () =>\n childMatchStatus() !== 'redirected' && parentGlobalNotFound()\n\n return (\n <Solid.Show\n when={!shouldShowNotFound() && childMatchId()}\n fallback={\n <Solid.Show when={shouldShowNotFound() && route()}>\n {(resolvedRoute) =>\n renderRouteNotFound(router, resolvedRoute(), undefined)\n }\n </Solid.Show>\n }\n >\n {(childMatchIdAccessor) => {\n const currentMatchId = Solid.createMemo(() => childMatchIdAccessor())\n\n return (\n <Solid.Show\n when={routeId() === rootRouteId}\n fallback={<Match matchId={currentMatchId()} />}\n >\n <Solid.Suspense\n fallback={\n <Dynamic component={router.options.defaultPendingComponent} />\n }\n >\n <Match matchId={currentMatchId()} />\n </Solid.Suspense>\n </Solid.Show>\n )\n }}\n </Solid.Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAoBA,IAAamB,SAASC,UAA+B;CACnD,MAAME,SAASX,kBAAAA,WAAW;CAE1B,MAAMY,QAAQvB,SAAMwB,iBAAiB;EACnC,MAAMC,KAAKL,MAAMC;AACjB,MAAI,CAACI,GAAI,QAAOC,KAAAA;AAChB,SAAOJ,OAAOK,OAAOC,sBAAsBC,IAAIJ,GAAG,EAAEK;GACpD;CAEF,MAAMC,gBAAgB/B,SAAMwB,iBAAiB;EAC3C,MAAMQ,eAAeT,OAAO;AAC5B,MAAI,CAACS,aACH,QAAO;EAGT,MAAMC,UAAUD,aAAaC;EAC7B,MAAMC,gBAAiBZ,OAAOa,WAAWF,UAAuBG,aAC5DX;AAEJ,SAAO;GACLJ,SAASW,aAAaP;GACtBQ;GACAI,KAAKL,aAAaK;GAClBC,iBAAiBN,aAAaM;GACfJ;GAChB;GACD;CAQF,MAAMS,eAAe;EACnBtB,eAAeU,eAAe,EAAEV;EAChCY,eAAeF,eAAe,EAAEE;EAChCV;EACAqB,YAVsB5C,SAAMwB,iBAAiB;GAC7C,MAAMgB,iBAAiBT,eAAe,EAAEE;AACxC,UAAOO,iBACHC,QAAQnB,OAAOK,OAAOe,gBAAgBZ,MAAMU,gBAAgB,GAC5D;IACJ;EAMD;AAED,SAAA,GAAA,aAAA,iBACGxC,SAAM8C,MAAI;EAAA,IAACC,OAAI;AAAA,UAAEhB,eAAe;;EAAAiB,WAC7BC,sBAAsB;GACtB,MAAMC,cACJ5B,OAAOa,WAAWc,mBAAmB,CAAChB;GAExC,MAAMkB,gCACJD,OAAO,CAACE,QAAQC,oBAChB/B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IAAIH,cAAc;;EAAA,IAC7CvE,WAAQ;AAAA,WAAA,GAAA,aAAA,iBACL3E,SAAM8C,MAAI;IAAA,IAACC,OAAI;AAAA,aAAA,GAAA,aAAA,YAAE,CAAA,CAAAsG,oBAAoB,CAAA,EAAA,IAAInG,OAAO;;IAAAF,WAC7CsG,kBACAvI,4BAAAA,oBAAoBO,QAAQgI,eAAe,EAAE5H,KAAAA,EAAS;IAAC,CAAA;;EAAAsB,WAK3DuG,yBAAyB;GACzB,MAAMC,iBAAiBxJ,SAAMwB,iBAAiB+H,sBAAsB,CAAC;AAErE,WAAA,GAAA,aAAA,iBACGvJ,SAAM8C,MAAI;IAAA,IACTC,OAAI;AAAA,YAAEd,SAAS,KAAK3B,sBAAAA;;IAAW,IAC/BqE,WAAQ;AAAA,aAAA,GAAA,aAAA,iBAAGxD,OAAK,EAAA,IAACE,UAAO;AAAA,aAAEmI,gBAAgB;QAAA,CAAA;;IAAA,IAAAxG,WAAA;AAAA,aAAA,GAAA,aAAA,iBAEzChD,SAAMoE,UAAQ;MAAA,IACbO,WAAQ;AAAA,eAAA,GAAA,aAAA,iBACLnE,aAAAA,SAAO,EAAA,IAACyD,YAAS;AAAA,eAAE3C,OAAO8B,QAAQE;UAAuB,CAAA;;MAAA,IAAAN,WAAA;AAAA,eAAA,GAAA,aAAA,iBAG3D7B,OAAK,EAAA,IAACE,UAAO;AAAA,eAAEmI,gBAAgB;UAAA,CAAA;;MAAA,CAAA;;IAAA,CAAA;;EAIvC,CAAA"}
1
+ {"version":3,"file":"Match.cjs","names":["Solid","createControlledPromise","getLocationChangeInfo","invariant","isNotFound","isRedirect","rootRouteId","isServer","Dynamic","CatchBoundary","ErrorComponent","useRouter","CatchNotFound","getNotFound","nearestMatchContext","SafeFragment","renderRouteNotFound","ScrollRestoration","AnyRoute","RootRouteOptions","Match","props","matchId","router","match","createMemo","id","undefined","stores","activeMatchStoresById","get","state","rawMatchState","currentMatch","routeId","parentRouteId","routesById","parentRoute","ssr","_displayPending","hasPendingMatch","currentRouteId","Boolean","pendingRouteIds","nearestMatch","hasPending","_$createComponent","Show","when","children","currentMatchState","route","resolvePendingComponent","options","pendingComponent","defaultPendingComponent","routeErrorComponent","errorComponent","defaultErrorComponent","routeOnCatch","onCatch","defaultOnCatch","routeNotFoundComponent","isRoot","notFoundComponent","notFoundRoute","component","resolvedNoSsr","ResolvedSuspenseBoundary","Suspense","ResolvedCatchBoundary","ResolvedNotFoundBoundary","ShellComponent","shellComponent","Provider","value","fallback","_$memo","getResetKey","loadedAt","error","Error","notFoundError","process","env","NODE_ENV","console","warn","_$mergeProps","Switch","MatchInner","OnRendered","scrollRestoration","location","resolvedLocation","__TSR_key","createEffect","on","emit","type","useContext","remountFn","remountDeps","defaultRemountDeps","loaderDeps","params","_strictParams","search","_strictSearch","key","JSON","stringify","status","_forcePending","componentKey","out","Comp","defaultComponent","Outlet","keyedOut","keyed","_key","_","displayPendingResult","createResource","getMatch","_nonReactive","displayPendingPromise","minPendingResult","minPendingPromise","pendingMinMs","defaultPendingMinMs","routerMatch","setTimeout","resolve","loaderResult","Promise","r","loadPromise","FallbackComponent","_routeId","RouteErrorComponent","info","componentStack","nearestParentMatch","parentMatch","parentGlobalNotFound","globalNotFound","childMatchId","childMatchIdByRouteId","childMatchStatus","shouldShowNotFound","resolvedRoute","childMatchIdAccessor","currentMatchId"],"sources":["../../src/Match.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport {\n createControlledPromise,\n getLocationChangeInfo,\n invariant,\n isNotFound,\n isRedirect,\n rootRouteId,\n} from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { Dynamic } from 'solid-js/web'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport { CatchNotFound, getNotFound } from './not-found'\nimport { nearestMatchContext } from './matchContext'\nimport { SafeFragment } from './SafeFragment'\nimport { renderRouteNotFound } from './renderRouteNotFound'\nimport { ScrollRestoration } from './scroll-restoration'\nimport type { AnyRoute, RootRouteOptions } from '@tanstack/router-core'\n\nexport const Match = (props: { matchId: string }) => {\n const router = useRouter()\n\n const match = Solid.createMemo(() => {\n const id = props.matchId\n if (!id) return undefined\n return router.stores.activeMatchStoresById.get(id)?.state\n })\n\n const rawMatchState = Solid.createMemo(() => {\n const currentMatch = match()\n if (!currentMatch) {\n return null\n }\n\n const routeId = currentMatch.routeId as string\n const parentRouteId = (router.routesById[routeId] as AnyRoute)?.parentRoute\n ?.id\n\n return {\n matchId: currentMatch.id,\n routeId,\n ssr: currentMatch.ssr,\n _displayPending: currentMatch._displayPending,\n parentRouteId: parentRouteId as string | undefined,\n }\n })\n\n const hasPendingMatch = Solid.createMemo(() => {\n const currentRouteId = rawMatchState()?.routeId\n return currentRouteId\n ? Boolean(router.stores.pendingRouteIds.state[currentRouteId])\n : false\n })\n const nearestMatch = {\n matchId: () => rawMatchState()?.matchId,\n routeId: () => rawMatchState()?.routeId,\n match,\n hasPending: hasPendingMatch,\n }\n\n return (\n <Solid.Show when={rawMatchState()}>\n {(currentMatchState) => {\n const route: () => AnyRoute = () =>\n router.routesById[currentMatchState().routeId]\n\n const resolvePendingComponent = () =>\n route().options.pendingComponent ??\n router.options.defaultPendingComponent\n\n const routeErrorComponent = () =>\n route().options.errorComponent ?? router.options.defaultErrorComponent\n\n const routeOnCatch = () =>\n route().options.onCatch ?? router.options.defaultOnCatch\n\n const routeNotFoundComponent = () =>\n route().isRoot\n ? // If it's the root route, use the globalNotFound option, with fallback to the notFoundRoute's component\n (route().options.notFoundComponent ??\n router.options.notFoundRoute?.options.component)\n : route().options.notFoundComponent\n\n const resolvedNoSsr =\n currentMatchState().ssr === false ||\n currentMatchState().ssr === 'data-only'\n\n const ResolvedSuspenseBoundary = () => Solid.Suspense\n\n const ResolvedCatchBoundary = () =>\n routeErrorComponent() ? CatchBoundary : SafeFragment\n\n const ResolvedNotFoundBoundary = () =>\n routeNotFoundComponent() ? CatchNotFound : SafeFragment\n\n const ShellComponent = route().isRoot\n ? ((route().options as RootRouteOptions).shellComponent ??\n SafeFragment)\n : SafeFragment\n\n return (\n <ShellComponent>\n <nearestMatchContext.Provider value={nearestMatch}>\n <Dynamic\n component={ResolvedSuspenseBoundary()}\n fallback={\n // Don't show fallback on server when using no-ssr mode to avoid hydration mismatch\n (isServer ?? router.isServer) && resolvedNoSsr ? undefined : (\n <Dynamic component={resolvePendingComponent()} />\n )\n }\n >\n <Dynamic\n component={ResolvedCatchBoundary()}\n getResetKey={() => router.stores.loadedAt.state}\n errorComponent={routeErrorComponent() || ErrorComponent}\n onCatch={(error: Error) => {\n // Forward not found errors (we don't want to show the error component for these)\n const notFoundError = getNotFound(error)\n if (notFoundError) {\n notFoundError.routeId ??= currentMatchState()\n .routeId as any\n throw notFoundError\n }\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `Warning: Error in route match: ${currentMatchState().routeId}`,\n )\n }\n routeOnCatch()?.(error)\n }}\n >\n <Dynamic\n component={ResolvedNotFoundBoundary()}\n fallback={(error: any) => {\n const notFoundError = getNotFound(error) ?? error\n\n notFoundError.routeId ??= currentMatchState()\n .routeId as any\n\n // If the current not found handler doesn't exist or it has a\n // route ID which doesn't match the current route, rethrow the error\n if (\n !routeNotFoundComponent() ||\n (notFoundError.routeId &&\n notFoundError.routeId !==\n currentMatchState().routeId) ||\n (!notFoundError.routeId && !route().isRoot)\n )\n throw notFoundError\n\n return (\n <Dynamic\n component={routeNotFoundComponent()}\n {...notFoundError}\n />\n )\n }}\n >\n <Solid.Switch>\n <Solid.Match when={resolvedNoSsr}>\n <Solid.Show\n when={!(isServer ?? router.isServer)}\n fallback={\n <Dynamic component={resolvePendingComponent()} />\n }\n >\n <MatchInner />\n </Solid.Show>\n </Solid.Match>\n <Solid.Match when={!resolvedNoSsr}>\n <MatchInner />\n </Solid.Match>\n </Solid.Switch>\n </Dynamic>\n </Dynamic>\n </Dynamic>\n </nearestMatchContext.Provider>\n\n {currentMatchState().parentRouteId === rootRouteId ? (\n <>\n <OnRendered />\n {router.options.scrollRestoration &&\n (isServer ?? router.isServer) ? (\n <ScrollRestoration />\n ) : null}\n </>\n ) : null}\n </ShellComponent>\n )\n }}\n </Solid.Show>\n )\n}\n\n// On Rendered can't happen above the root layout because it needs to run\n// after the app has committed below the root layout. Keeping it here lets us\n// fire onRendered even after a hydration mismatch above the root layout\n// (like bad head/link tags, which is common).\nfunction OnRendered() {\n const router = useRouter()\n\n const location = Solid.createMemo(\n () => router.stores.resolvedLocation.state?.state.__TSR_key,\n )\n Solid.createEffect(\n Solid.on([location], () => {\n router.emit({\n type: 'onRendered',\n ...getLocationChangeInfo(\n router.stores.location.state,\n router.stores.resolvedLocation.state,\n ),\n })\n }),\n )\n return null\n}\n\nexport const MatchInner = (): any => {\n const router = useRouter()\n const match = Solid.useContext(nearestMatchContext).match\n\n const rawMatchState = Solid.createMemo(() => {\n const currentMatch = match()\n if (!currentMatch) {\n return null\n }\n\n const routeId = currentMatch.routeId as string\n\n const remountFn =\n (router.routesById[routeId] as AnyRoute).options.remountDeps ??\n router.options.defaultRemountDeps\n const remountDeps = remountFn?.({\n routeId,\n loaderDeps: currentMatch.loaderDeps,\n params: currentMatch._strictParams,\n search: currentMatch._strictSearch,\n })\n const key = remountDeps ? JSON.stringify(remountDeps) : undefined\n\n return {\n key,\n routeId,\n match: {\n id: currentMatch.id,\n status: currentMatch.status,\n error: currentMatch.error,\n _forcePending: currentMatch._forcePending ?? false,\n _displayPending: currentMatch._displayPending ?? false,\n },\n }\n })\n\n return (\n <Solid.Show when={rawMatchState()}>\n {(currentMatchState) => {\n const route = () => router.routesById[currentMatchState().routeId]!\n\n const currentMatch = () => currentMatchState().match\n\n const componentKey = () =>\n currentMatchState().key ?? currentMatchState().match.id\n\n const out = () => {\n const Comp =\n route().options.component ?? router.options.defaultComponent\n if (Comp) {\n return <Comp />\n }\n return <Outlet />\n }\n\n const keyedOut = () => (\n <Solid.Show when={componentKey()} keyed>\n {(_key) => out()}\n </Solid.Show>\n )\n\n return (\n <Solid.Switch>\n <Solid.Match when={currentMatch()._displayPending}>\n {(_) => {\n const [displayPendingResult] = Solid.createResource(\n () =>\n router.getMatch(currentMatch().id)?._nonReactive\n .displayPendingPromise,\n )\n\n return <>{displayPendingResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch()._forcePending}>\n {(_) => {\n const [minPendingResult] = Solid.createResource(\n () =>\n router.getMatch(currentMatch().id)?._nonReactive\n .minPendingPromise,\n )\n\n return <>{minPendingResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'pending'}>\n {(_) => {\n const pendingMinMs =\n route().options.pendingMinMs ??\n router.options.defaultPendingMinMs\n\n if (pendingMinMs) {\n const routerMatch = router.getMatch(currentMatch().id)\n if (\n routerMatch &&\n !routerMatch._nonReactive.minPendingPromise\n ) {\n // Create a promise that will resolve after the minPendingMs\n if (!(isServer ?? router.isServer)) {\n const minPendingPromise = createControlledPromise<void>()\n\n routerMatch._nonReactive.minPendingPromise =\n minPendingPromise\n\n setTimeout(() => {\n minPendingPromise.resolve()\n // We've handled the minPendingPromise, so we can delete it\n routerMatch._nonReactive.minPendingPromise = undefined\n }, pendingMinMs)\n }\n }\n }\n\n const [loaderResult] = Solid.createResource(async () => {\n await new Promise((r) => setTimeout(r, 0))\n return router.getMatch(currentMatch().id)?._nonReactive\n .loadPromise\n })\n\n const FallbackComponent =\n route().options.pendingComponent ??\n router.options.defaultPendingComponent\n\n return (\n <>\n {FallbackComponent && pendingMinMs > 0 ? (\n <Dynamic component={FallbackComponent} />\n ) : null}\n {loaderResult()}\n </>\n )\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'notFound'}>\n {(_) => {\n if (!isNotFound(currentMatch().error)) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n 'Invariant failed: Expected a notFound error',\n )\n }\n\n invariant()\n }\n\n // Use Show with keyed to ensure re-render when routeId changes\n return (\n <Solid.Show when={currentMatchState().routeId} keyed>\n {(_routeId) =>\n renderRouteNotFound(router, route(), currentMatch().error)\n }\n </Solid.Show>\n )\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'redirected'}>\n {(_) => {\n if (!isRedirect(currentMatch().error)) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n 'Invariant failed: Expected a redirect error',\n )\n }\n\n invariant()\n }\n\n const [loaderResult] = Solid.createResource(async () => {\n await new Promise((r) => setTimeout(r, 0))\n return router.getMatch(currentMatch().id)?._nonReactive\n .loadPromise\n })\n\n return <>{loaderResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'error'}>\n {(_) => {\n if (isServer ?? router.isServer) {\n const RouteErrorComponent =\n (route().options.errorComponent ??\n router.options.defaultErrorComponent) ||\n ErrorComponent\n\n return (\n <RouteErrorComponent\n error={currentMatch().error}\n info={{\n componentStack: '',\n }}\n />\n )\n }\n\n throw currentMatch().error\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'success'}>\n {keyedOut()}\n </Solid.Match>\n </Solid.Switch>\n )\n }}\n </Solid.Show>\n )\n}\n\nexport const Outlet = () => {\n const router = useRouter()\n const nearestParentMatch = Solid.useContext(nearestMatchContext)\n const parentMatch = nearestParentMatch.match\n const routeId = nearestParentMatch.routeId\n const route = Solid.createMemo(() =>\n routeId() ? router.routesById[routeId()!] : undefined,\n )\n\n const parentGlobalNotFound = Solid.createMemo(\n () => parentMatch()?.globalNotFound ?? false,\n )\n\n const childMatchId = Solid.createMemo(() => {\n const currentRouteId = routeId()\n return currentRouteId\n ? router.stores.childMatchIdByRouteId.state[currentRouteId]\n : undefined\n })\n\n const childMatchStatus = Solid.createMemo(() => {\n const id = childMatchId()\n if (!id) return undefined\n return router.stores.activeMatchStoresById.get(id)?.state.status\n })\n\n // Only show not-found if we're not in a redirected state\n const shouldShowNotFound = () =>\n childMatchStatus() !== 'redirected' && parentGlobalNotFound()\n\n return (\n <Solid.Show\n when={!shouldShowNotFound() && childMatchId()}\n fallback={\n <Solid.Show when={shouldShowNotFound() && route()}>\n {(resolvedRoute) =>\n renderRouteNotFound(router, resolvedRoute(), undefined)\n }\n </Solid.Show>\n }\n >\n {(childMatchIdAccessor) => {\n const currentMatchId = Solid.createMemo(() => childMatchIdAccessor())\n\n return (\n <Solid.Show\n when={routeId() === rootRouteId}\n fallback={<Match matchId={currentMatchId()} />}\n >\n <Solid.Suspense\n fallback={\n <Dynamic component={router.options.defaultPendingComponent} />\n }\n >\n <Match matchId={currentMatchId()} />\n </Solid.Suspense>\n </Solid.Show>\n )\n }}\n </Solid.Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAoBA,IAAaoB,SAASC,UAA+B;CACnD,MAAME,SAASZ,kBAAAA,WAAW;CAE1B,MAAMa,QAAQxB,SAAMyB,iBAAiB;EACnC,MAAMC,KAAKL,MAAMC;AACjB,MAAI,CAACI,GAAI,QAAOC,KAAAA;AAChB,SAAOJ,OAAOK,OAAOC,sBAAsBC,IAAIJ,GAAG,EAAEK;GACpD;CAEF,MAAMC,gBAAgBhC,SAAMyB,iBAAiB;EAC3C,MAAMQ,eAAeT,OAAO;AAC5B,MAAI,CAACS,aACH,QAAO;EAGT,MAAMC,UAAUD,aAAaC;EAC7B,MAAMC,gBAAiBZ,OAAOa,WAAWF,UAAuBG,aAC5DX;AAEJ,SAAO;GACLJ,SAASW,aAAaP;GACtBQ;GACAI,KAAKL,aAAaK;GAClBC,iBAAiBN,aAAaM;GACfJ;GAChB;GACD;CAQF,MAAMS,eAAe;EACnBtB,eAAeU,eAAe,EAAEV;EAChCY,eAAeF,eAAe,EAAEE;EAChCV;EACAqB,YAVsB7C,SAAMyB,iBAAiB;GAC7C,MAAMgB,iBAAiBT,eAAe,EAAEE;AACxC,UAAOO,iBACHC,QAAQnB,OAAOK,OAAOe,gBAAgBZ,MAAMU,gBAAgB,GAC5D;IACJ;EAMD;AAED,SAAA,GAAA,aAAA,iBACGzC,SAAM+C,MAAI;EAAA,IAACC,OAAI;AAAA,UAAEh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;EAIvC,CAAA"}
@@ -7,6 +7,10 @@ let solid_js = require("solid-js");
7
7
  solid_js = require_runtime.__toESM(solid_js);
8
8
  //#region src/not-found.tsx
9
9
  var _tmpl$ = /* @__PURE__ */ (0, solid_js_web.template)(`<p>Not Found`);
10
+ function getNotFound(error) {
11
+ if ((0, _tanstack_router_core.isNotFound)(error)) return error;
12
+ if ((0, _tanstack_router_core.isNotFound)(error?.cause)) return error.cause;
13
+ }
10
14
  function CatchNotFound(props) {
11
15
  const router = require_useRouter.useRouter();
12
16
  const pathname = solid_js.createMemo(() => router.stores.location.state.pathname);
@@ -14,11 +18,13 @@ function CatchNotFound(props) {
14
18
  return (0, solid_js_web.createComponent)(require_CatchBoundary.CatchBoundary, {
15
19
  getResetKey: () => `not-found-${pathname()}-${status()}`,
16
20
  onCatch: (error) => {
17
- if ((0, _tanstack_router_core.isNotFound)(error)) props.onCatch?.(error);
21
+ const notFoundError = getNotFound(error);
22
+ if (notFoundError) props.onCatch?.(notFoundError);
18
23
  else throw error;
19
24
  },
20
25
  errorComponent: ({ error }) => {
21
- if ((0, _tanstack_router_core.isNotFound)(error)) return props.fallback?.(error);
26
+ const notFoundError = getNotFound(error);
27
+ if (notFoundError) return props.fallback?.(notFoundError);
22
28
  else throw error;
23
29
  },
24
30
  get children() {
@@ -32,5 +38,6 @@ function DefaultGlobalNotFound() {
32
38
  //#endregion
33
39
  exports.CatchNotFound = CatchNotFound;
34
40
  exports.DefaultGlobalNotFound = DefaultGlobalNotFound;
41
+ exports.getNotFound = getNotFound;
35
42
 
36
43
  //# sourceMappingURL=not-found.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"not-found.cjs","names":["isNotFound","Solid","CatchBoundary","useRouter","NotFoundError","CatchNotFound","props","fallback","error","JSX","Element","onCatch","Error","children","router","pathname","createMemo","stores","location","state","status","_$createComponent","getResetKey","errorComponent","DefaultGlobalNotFound","_tmpl$"],"sources":["../../src/not-found.tsx"],"sourcesContent":["import { isNotFound } from '@tanstack/router-core'\nimport * as Solid from 'solid-js'\nimport { CatchBoundary } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport type { NotFoundError } from '@tanstack/router-core'\n\nexport function CatchNotFound(props: {\n fallback?: (error: NotFoundError) => Solid.JSX.Element\n onCatch?: (error: Error) => void\n children: Solid.JSX.Element\n}) {\n const router = useRouter()\n // TODO: Some way for the user to programmatically reset the not-found boundary?\n const pathname = Solid.createMemo(() => router.stores.location.state.pathname)\n const status = Solid.createMemo(() => router.stores.status.state)\n\n return (\n <CatchBoundary\n getResetKey={() => `not-found-${pathname()}-${status()}`}\n onCatch={(error) => {\n if (isNotFound(error)) {\n props.onCatch?.(error)\n } else {\n throw error\n }\n }}\n errorComponent={({ error }) => {\n if (isNotFound(error)) {\n return props.fallback?.(error)\n } else {\n throw error\n }\n }}\n >\n {props.children}\n </CatchBoundary>\n )\n}\n\nexport function DefaultGlobalNotFound() {\n return <p>Not Found</p>\n}\n"],"mappings":";;;;;;;;;AAMA,SAAgBK,cAAcC,OAI3B;CACD,MAAMQ,SAASX,kBAAAA,WAAW;CAE1B,MAAMY,WAAWd,SAAMe,iBAAiBF,OAAOG,OAAOC,SAASC,MAAMJ,SAAS;CAC9E,MAAMK,SAASnB,SAAMe,iBAAiBF,OAAOG,OAAOG,OAAOD,MAAM;AAEjE,SAAA,GAAA,aAAA,iBACGjB,sBAAAA,eAAa;EACZoB,mBAAmB,aAAaP,UAAU,CAAA,GAAIK,QAAQ;EACtDT,UAAUH,UAAU;AAClB,QAAA,GAAA,sBAAA,YAAeA,MAAM,CACnBF,OAAMK,UAAUH,MAAM;OAEtB,OAAMA;;EAGVe,iBAAiB,EAAEf,YAAY;AAC7B,QAAA,GAAA,sBAAA,YAAeA,MAAM,CACnB,QAAOF,MAAMC,WAAWC,MAAM;OAE9B,OAAMA;;EAET,IAAAK,WAAA;AAAA,UAEAP,MAAMO;;EAAQ,CAAA;;AAKrB,SAAgBW,wBAAwB;AACtC,QAAAC,QAAA"}
1
+ {"version":3,"file":"not-found.cjs","names":["isNotFound","Solid","CatchBoundary","useRouter","NotFoundError","getNotFound","error","cause","undefined","CatchNotFound","props","fallback","JSX","Element","onCatch","children","router","pathname","createMemo","stores","location","state","status","_$createComponent","getResetKey","notFoundError","errorComponent","DefaultGlobalNotFound","_tmpl$"],"sources":["../../src/not-found.tsx"],"sourcesContent":["import { isNotFound } from '@tanstack/router-core'\nimport * as Solid from 'solid-js'\nimport { CatchBoundary } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport type { NotFoundError } from '@tanstack/router-core'\n\n// Solid wraps non-Error throws in an Error and stores the original thrown value\n// on `cause`, so component-thrown `notFound()` needs one extra unwrapping step.\nexport function getNotFound(\n error: unknown,\n): (NotFoundError & { isNotFound: true }) | undefined {\n if (isNotFound(error)) {\n return error as NotFoundError & { isNotFound: true }\n }\n\n if (isNotFound((error as any)?.cause)) {\n return (error as any).cause as NotFoundError & { isNotFound: true }\n }\n\n return undefined\n}\n\nexport function CatchNotFound(props: {\n fallback?: (error: NotFoundError) => Solid.JSX.Element\n onCatch?: (error: NotFoundError) => void\n children: Solid.JSX.Element\n}) {\n const router = useRouter()\n // TODO: Some way for the user to programmatically reset the not-found boundary?\n const pathname = Solid.createMemo(() => router.stores.location.state.pathname)\n const status = Solid.createMemo(() => router.stores.status.state)\n\n return (\n <CatchBoundary\n getResetKey={() => `not-found-${pathname()}-${status()}`}\n onCatch={(error) => {\n const notFoundError = getNotFound(error)\n\n if (notFoundError) {\n props.onCatch?.(notFoundError)\n } else {\n throw error\n }\n }}\n errorComponent={({ error }) => {\n const notFoundError = getNotFound(error)\n\n if (notFoundError) {\n return props.fallback?.(notFoundError)\n } else {\n throw error\n }\n }}\n >\n {props.children}\n </CatchBoundary>\n )\n}\n\nexport function DefaultGlobalNotFound() {\n return <p>Not Found</p>\n}\n"],"mappings":";;;;;;;;;AAQA,SAAgBK,YACdC,OACoD;AACpD,MAAA,GAAA,sBAAA,YAAeA,MAAM,CACnB,QAAOA;AAGT,MAAA,GAAA,sBAAA,YAAgBA,OAAeC,MAAM,CACnC,QAAQD,MAAcC;;AAM1B,SAAgBE,cAAcC,OAI3B;CACD,MAAMM,SAASb,kBAAAA,WAAW;CAE1B,MAAMc,WAAWhB,SAAMiB,iBAAiBF,OAAOG,OAAOC,SAASC,MAAMJ,SAAS;CAC9E,MAAMK,SAASrB,SAAMiB,iBAAiBF,OAAOG,OAAOG,OAAOD,MAAM;AAEjE,SAAA,GAAA,aAAA,iBACGnB,sBAAAA,eAAa;EACZsB,mBAAmB,aAAaP,UAAU,CAAA,GAAIK,QAAQ;EACtDR,UAAUR,UAAU;GAClB,MAAMmB,gBAAgBpB,YAAYC,MAAM;AAExC,OAAImB,cACFf,OAAMI,UAAUW,cAAc;OAE9B,OAAMnB;;EAGVoB,iBAAiB,EAAEpB,YAAY;GAC7B,MAAMmB,gBAAgBpB,YAAYC,MAAM;AAExC,OAAImB,cACF,QAAOf,MAAMC,WAAWc,cAAc;OAEtC,OAAMnB;;EAET,IAAAS,WAAA;AAAA,UAEAL,MAAMK;;EAAQ,CAAA;;AAKrB,SAAgBY,wBAAwB;AACtC,QAAAC,QAAA"}
@@ -1,8 +1,11 @@
1
1
  import { NotFoundError } from '@tanstack/router-core';
2
2
  import * as Solid from 'solid-js';
3
+ export declare function getNotFound(error: unknown): (NotFoundError & {
4
+ isNotFound: true;
5
+ }) | undefined;
3
6
  export declare function CatchNotFound(props: {
4
7
  fallback?: (error: NotFoundError) => Solid.JSX.Element;
5
- onCatch?: (error: Error) => void;
8
+ onCatch?: (error: NotFoundError) => void;
6
9
  children: Solid.JSX.Element;
7
10
  }): Solid.JSX.Element;
8
11
  export declare function DefaultGlobalNotFound(): Solid.JSX.Element;
package/dist/esm/Match.js CHANGED
@@ -2,7 +2,7 @@ import { CatchBoundary, ErrorComponent } from "./CatchBoundary.js";
2
2
  import { useRouter } from "./useRouter.js";
3
3
  import { nearestMatchContext } from "./matchContext.js";
4
4
  import { SafeFragment } from "./SafeFragment.js";
5
- import { CatchNotFound } from "./not-found.js";
5
+ import { CatchNotFound, getNotFound } from "./not-found.js";
6
6
  import { renderRouteNotFound } from "./renderRouteNotFound.js";
7
7
  import { ScrollRestoration } from "./scroll-restoration.js";
8
8
  import { createControlledPromise, getLocationChangeInfo, invariant, isNotFound, isRedirect, rootRouteId } from "@tanstack/router-core";
@@ -76,7 +76,11 @@ var Match = (props) => {
76
76
  return routeErrorComponent() || ErrorComponent;
77
77
  },
78
78
  onCatch: (error) => {
79
- if (isNotFound(error)) throw error;
79
+ const notFoundError = getNotFound(error);
80
+ if (notFoundError) {
81
+ notFoundError.routeId ??= currentMatchState().routeId;
82
+ throw notFoundError;
83
+ }
80
84
  if (process.env.NODE_ENV !== "production") console.warn(`Warning: Error in route match: ${currentMatchState().routeId}`);
81
85
  routeOnCatch()?.(error);
82
86
  },
@@ -86,10 +90,12 @@ var Match = (props) => {
86
90
  return ResolvedNotFoundBoundary();
87
91
  },
88
92
  fallback: (error) => {
89
- if (!routeNotFoundComponent() || error.routeId && error.routeId !== currentMatchState().routeId || !error.routeId && !route().isRoot) throw error;
93
+ const notFoundError = getNotFound(error) ?? error;
94
+ notFoundError.routeId ??= currentMatchState().routeId;
95
+ if (!routeNotFoundComponent() || notFoundError.routeId && notFoundError.routeId !== currentMatchState().routeId || !notFoundError.routeId && !route().isRoot) throw notFoundError;
90
96
  return createComponent(Dynamic, mergeProps({ get component() {
91
97
  return routeNotFoundComponent();
92
- } }, error));
98
+ } }, notFoundError));
93
99
  },
94
100
  get children() {
95
101
  return createComponent(Solid.Switch, { get children() {
@@ -1 +1 @@
1
- {"version":3,"file":"Match.js","names":["Solid","createControlledPromise","getLocationChangeInfo","invariant","isNotFound","isRedirect","rootRouteId","isServer","Dynamic","CatchBoundary","ErrorComponent","useRouter","CatchNotFound","nearestMatchContext","SafeFragment","renderRouteNotFound","ScrollRestoration","AnyRoute","RootRouteOptions","Match","props","matchId","router","match","createMemo","id","undefined","stores","activeMatchStoresById","get","state","rawMatchState","currentMatch","routeId","parentRouteId","routesById","parentRoute","ssr","_displayPending","hasPendingMatch","currentRouteId","Boolean","pendingRouteIds","nearestMatch","hasPending","_$createComponent","Show","when","children","currentMatchState","route","resolvePendingComponent","options","pendingComponent","defaultPendingComponent","routeErrorComponent","errorComponent","defaultErrorComponent","routeOnCatch","onCatch","defaultOnCatch","routeNotFoundComponent","isRoot","notFoundComponent","notFoundRoute","component","resolvedNoSsr","ResolvedSuspenseBoundary","Suspense","ResolvedCatchBoundary","ResolvedNotFoundBoundary","ShellComponent","shellComponent","Provider","value","fallback","_$memo","getResetKey","loadedAt","error","Error","process","env","NODE_ENV","console","warn","_$mergeProps","Switch","MatchInner","OnRendered","scrollRestoration","location","resolvedLocation","__TSR_key","createEffect","on","emit","type","useContext","remountFn","remountDeps","defaultRemountDeps","loaderDeps","params","_strictParams","search","_strictSearch","key","JSON","stringify","status","_forcePending","componentKey","out","Comp","defaultComponent","Outlet","keyedOut","keyed","_key","_","displayPendingResult","createResource","getMatch","_nonReactive","displayPendingPromise","minPendingResult","minPendingPromise","pendingMinMs","defaultPendingMinMs","routerMatch","setTimeout","resolve","loaderResult","Promise","r","loadPromise","FallbackComponent","_routeId","RouteErrorComponent","info","componentStack","nearestParentMatch","parentMatch","parentGlobalNotFound","globalNotFound","childMatchId","childMatchIdByRouteId","childMatchStatus","shouldShowNotFound","resolvedRoute","childMatchIdAccessor","currentMatchId"],"sources":["../../src/Match.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport {\n createControlledPromise,\n getLocationChangeInfo,\n invariant,\n isNotFound,\n isRedirect,\n rootRouteId,\n} from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { Dynamic } from 'solid-js/web'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport { CatchNotFound } from './not-found'\nimport { nearestMatchContext } from './matchContext'\nimport { SafeFragment } from './SafeFragment'\nimport { renderRouteNotFound } from './renderRouteNotFound'\nimport { ScrollRestoration } from './scroll-restoration'\nimport type { AnyRoute, RootRouteOptions } from '@tanstack/router-core'\n\nexport const Match = (props: { matchId: string }) => {\n const router = useRouter()\n\n const match = Solid.createMemo(() => {\n const id = props.matchId\n if (!id) return undefined\n return router.stores.activeMatchStoresById.get(id)?.state\n })\n\n const rawMatchState = Solid.createMemo(() => {\n const currentMatch = match()\n if (!currentMatch) {\n return null\n }\n\n const routeId = currentMatch.routeId as string\n const parentRouteId = (router.routesById[routeId] as AnyRoute)?.parentRoute\n ?.id\n\n return {\n matchId: currentMatch.id,\n routeId,\n ssr: currentMatch.ssr,\n _displayPending: currentMatch._displayPending,\n parentRouteId: parentRouteId as string | undefined,\n }\n })\n\n const hasPendingMatch = Solid.createMemo(() => {\n const currentRouteId = rawMatchState()?.routeId\n return currentRouteId\n ? Boolean(router.stores.pendingRouteIds.state[currentRouteId])\n : false\n })\n const nearestMatch = {\n matchId: () => rawMatchState()?.matchId,\n routeId: () => rawMatchState()?.routeId,\n match,\n hasPending: hasPendingMatch,\n }\n\n return (\n <Solid.Show when={rawMatchState()}>\n {(currentMatchState) => {\n const route: () => AnyRoute = () =>\n router.routesById[currentMatchState().routeId]\n\n const resolvePendingComponent = () =>\n route().options.pendingComponent ??\n router.options.defaultPendingComponent\n\n const routeErrorComponent = () =>\n route().options.errorComponent ?? router.options.defaultErrorComponent\n\n const routeOnCatch = () =>\n route().options.onCatch ?? router.options.defaultOnCatch\n\n const routeNotFoundComponent = () =>\n route().isRoot\n ? // If it's the root route, use the globalNotFound option, with fallback to the notFoundRoute's component\n (route().options.notFoundComponent ??\n router.options.notFoundRoute?.options.component)\n : route().options.notFoundComponent\n\n const resolvedNoSsr =\n currentMatchState().ssr === false ||\n currentMatchState().ssr === 'data-only'\n\n const ResolvedSuspenseBoundary = () => Solid.Suspense\n\n const ResolvedCatchBoundary = () =>\n routeErrorComponent() ? CatchBoundary : SafeFragment\n\n const ResolvedNotFoundBoundary = () =>\n routeNotFoundComponent() ? CatchNotFound : SafeFragment\n\n const ShellComponent = route().isRoot\n ? ((route().options as RootRouteOptions).shellComponent ??\n SafeFragment)\n : SafeFragment\n\n return (\n <ShellComponent>\n <nearestMatchContext.Provider value={nearestMatch}>\n <Dynamic\n component={ResolvedSuspenseBoundary()}\n fallback={\n // Don't show fallback on server when using no-ssr mode to avoid hydration mismatch\n (isServer ?? router.isServer) && resolvedNoSsr ? undefined : (\n <Dynamic component={resolvePendingComponent()} />\n )\n }\n >\n <Dynamic\n component={ResolvedCatchBoundary()}\n getResetKey={() => router.stores.loadedAt.state}\n errorComponent={routeErrorComponent() || ErrorComponent}\n onCatch={(error: Error) => {\n // Forward not found errors (we don't want to show the error component for these)\n if (isNotFound(error)) throw error\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `Warning: Error in route match: ${currentMatchState().routeId}`,\n )\n }\n routeOnCatch()?.(error)\n }}\n >\n <Dynamic\n component={ResolvedNotFoundBoundary()}\n fallback={(error: any) => {\n // If the current not found handler doesn't exist or it has a\n // route ID which doesn't match the current route, rethrow the error\n if (\n !routeNotFoundComponent() ||\n (error.routeId &&\n error.routeId !== currentMatchState().routeId) ||\n (!error.routeId && !route().isRoot)\n )\n throw error\n\n return (\n <Dynamic\n component={routeNotFoundComponent()}\n {...error}\n />\n )\n }}\n >\n <Solid.Switch>\n <Solid.Match when={resolvedNoSsr}>\n <Solid.Show\n when={!(isServer ?? router.isServer)}\n fallback={\n <Dynamic component={resolvePendingComponent()} />\n }\n >\n <MatchInner />\n </Solid.Show>\n </Solid.Match>\n <Solid.Match when={!resolvedNoSsr}>\n <MatchInner />\n </Solid.Match>\n </Solid.Switch>\n </Dynamic>\n </Dynamic>\n </Dynamic>\n </nearestMatchContext.Provider>\n\n {currentMatchState().parentRouteId === rootRouteId ? (\n <>\n <OnRendered />\n {router.options.scrollRestoration &&\n (isServer ?? router.isServer) ? (\n <ScrollRestoration />\n ) : null}\n </>\n ) : null}\n </ShellComponent>\n )\n }}\n </Solid.Show>\n )\n}\n\n// On Rendered can't happen above the root layout because it needs to run\n// after the app has committed below the root layout. Keeping it here lets us\n// fire onRendered even after a hydration mismatch above the root layout\n// (like bad head/link tags, which is common).\nfunction OnRendered() {\n const router = useRouter()\n\n const location = Solid.createMemo(\n () => router.stores.resolvedLocation.state?.state.__TSR_key,\n )\n Solid.createEffect(\n Solid.on([location], () => {\n router.emit({\n type: 'onRendered',\n ...getLocationChangeInfo(\n router.stores.location.state,\n router.stores.resolvedLocation.state,\n ),\n })\n }),\n )\n return null\n}\n\nexport const MatchInner = (): any => {\n const router = useRouter()\n const match = Solid.useContext(nearestMatchContext).match\n\n const rawMatchState = Solid.createMemo(() => {\n const currentMatch = match()\n if (!currentMatch) {\n return null\n }\n\n const routeId = currentMatch.routeId as string\n\n const remountFn =\n (router.routesById[routeId] as AnyRoute).options.remountDeps ??\n router.options.defaultRemountDeps\n const remountDeps = remountFn?.({\n routeId,\n loaderDeps: currentMatch.loaderDeps,\n params: currentMatch._strictParams,\n search: currentMatch._strictSearch,\n })\n const key = remountDeps ? JSON.stringify(remountDeps) : undefined\n\n return {\n key,\n routeId,\n match: {\n id: currentMatch.id,\n status: currentMatch.status,\n error: currentMatch.error,\n _forcePending: currentMatch._forcePending ?? false,\n _displayPending: currentMatch._displayPending ?? false,\n },\n }\n })\n\n return (\n <Solid.Show when={rawMatchState()}>\n {(currentMatchState) => {\n const route = () => router.routesById[currentMatchState().routeId]!\n\n const currentMatch = () => currentMatchState().match\n\n const componentKey = () =>\n currentMatchState().key ?? currentMatchState().match.id\n\n const out = () => {\n const Comp =\n route().options.component ?? router.options.defaultComponent\n if (Comp) {\n return <Comp />\n }\n return <Outlet />\n }\n\n const keyedOut = () => (\n <Solid.Show when={componentKey()} keyed>\n {(_key) => out()}\n </Solid.Show>\n )\n\n return (\n <Solid.Switch>\n <Solid.Match when={currentMatch()._displayPending}>\n {(_) => {\n const [displayPendingResult] = Solid.createResource(\n () =>\n router.getMatch(currentMatch().id)?._nonReactive\n .displayPendingPromise,\n )\n\n return <>{displayPendingResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch()._forcePending}>\n {(_) => {\n const [minPendingResult] = Solid.createResource(\n () =>\n router.getMatch(currentMatch().id)?._nonReactive\n .minPendingPromise,\n )\n\n return <>{minPendingResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'pending'}>\n {(_) => {\n const pendingMinMs =\n route().options.pendingMinMs ??\n router.options.defaultPendingMinMs\n\n if (pendingMinMs) {\n const routerMatch = router.getMatch(currentMatch().id)\n if (\n routerMatch &&\n !routerMatch._nonReactive.minPendingPromise\n ) {\n // Create a promise that will resolve after the minPendingMs\n if (!(isServer ?? router.isServer)) {\n const minPendingPromise = createControlledPromise<void>()\n\n routerMatch._nonReactive.minPendingPromise =\n minPendingPromise\n\n setTimeout(() => {\n minPendingPromise.resolve()\n // We've handled the minPendingPromise, so we can delete it\n routerMatch._nonReactive.minPendingPromise = undefined\n }, pendingMinMs)\n }\n }\n }\n\n const [loaderResult] = Solid.createResource(async () => {\n await new Promise((r) => setTimeout(r, 0))\n return router.getMatch(currentMatch().id)?._nonReactive\n .loadPromise\n })\n\n const FallbackComponent =\n route().options.pendingComponent ??\n router.options.defaultPendingComponent\n\n return (\n <>\n {FallbackComponent && pendingMinMs > 0 ? (\n <Dynamic component={FallbackComponent} />\n ) : null}\n {loaderResult()}\n </>\n )\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'notFound'}>\n {(_) => {\n if (!isNotFound(currentMatch().error)) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n 'Invariant failed: Expected a notFound error',\n )\n }\n\n invariant()\n }\n\n // Use Show with keyed to ensure re-render when routeId changes\n return (\n <Solid.Show when={currentMatchState().routeId} keyed>\n {(_routeId) =>\n renderRouteNotFound(router, route(), currentMatch().error)\n }\n </Solid.Show>\n )\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'redirected'}>\n {(_) => {\n if (!isRedirect(currentMatch().error)) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n 'Invariant failed: Expected a redirect error',\n )\n }\n\n invariant()\n }\n\n const [loaderResult] = Solid.createResource(async () => {\n await new Promise((r) => setTimeout(r, 0))\n return router.getMatch(currentMatch().id)?._nonReactive\n .loadPromise\n })\n\n return <>{loaderResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'error'}>\n {(_) => {\n if (isServer ?? router.isServer) {\n const RouteErrorComponent =\n (route().options.errorComponent ??\n router.options.defaultErrorComponent) ||\n ErrorComponent\n\n return (\n <RouteErrorComponent\n error={currentMatch().error}\n info={{\n componentStack: '',\n }}\n />\n )\n }\n\n throw currentMatch().error\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'success'}>\n {keyedOut()}\n </Solid.Match>\n </Solid.Switch>\n )\n }}\n </Solid.Show>\n )\n}\n\nexport const Outlet = () => {\n const router = useRouter()\n const nearestParentMatch = Solid.useContext(nearestMatchContext)\n const parentMatch = nearestParentMatch.match\n const routeId = nearestParentMatch.routeId\n const route = Solid.createMemo(() =>\n routeId() ? router.routesById[routeId()!] : undefined,\n )\n\n const parentGlobalNotFound = Solid.createMemo(\n () => parentMatch()?.globalNotFound ?? false,\n )\n\n const childMatchId = Solid.createMemo(() => {\n const currentRouteId = routeId()\n return currentRouteId\n ? router.stores.childMatchIdByRouteId.state[currentRouteId]\n : undefined\n })\n\n const childMatchStatus = Solid.createMemo(() => {\n const id = childMatchId()\n if (!id) return undefined\n return router.stores.activeMatchStoresById.get(id)?.state.status\n })\n\n // Only show not-found if we're not in a redirected state\n const shouldShowNotFound = () =>\n childMatchStatus() !== 'redirected' && parentGlobalNotFound()\n\n return (\n <Solid.Show\n when={!shouldShowNotFound() && childMatchId()}\n fallback={\n <Solid.Show when={shouldShowNotFound() && route()}>\n {(resolvedRoute) =>\n renderRouteNotFound(router, resolvedRoute(), undefined)\n }\n </Solid.Show>\n }\n >\n {(childMatchIdAccessor) => {\n const currentMatchId = Solid.createMemo(() => childMatchIdAccessor())\n\n return (\n <Solid.Show\n when={routeId() === rootRouteId}\n fallback={<Match matchId={currentMatchId()} />}\n >\n <Solid.Suspense\n fallback={\n <Dynamic component={router.options.defaultPendingComponent} />\n }\n >\n <Match matchId={currentMatchId()} />\n </Solid.Suspense>\n </Solid.Show>\n )\n }}\n </Solid.Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;AAoBA,IAAamB,SAASC,UAA+B;CACnD,MAAME,SAASX,WAAW;CAE1B,MAAMY,QAAQvB,MAAMwB,iBAAiB;EACnC,MAAMC,KAAKL,MAAMC;AACjB,MAAI,CAACI,GAAI,QAAOC,KAAAA;AAChB,SAAOJ,OAAOK,OAAOC,sBAAsBC,IAAIJ,GAAG,EAAEK;GACpD;CAEF,MAAMC,gBAAgB/B,MAAMwB,iBAAiB;EAC3C,MAAMQ,eAAeT,OAAO;AAC5B,MAAI,CAACS,aACH,QAAO;EAGT,MAAMC,UAAUD,aAAaC;EAC7B,MAAMC,gBAAiBZ,OAAOa,WAAWF,UAAuBG,aAC5DX;AAEJ,SAAO;GACLJ,SAASW,aAAaP;GACtBQ;GACAI,KAAKL,aAAaK;GAClBC,iBAAiBN,aAAaM;GACfJ;GAChB;GACD;CAQF,MAAMS,eAAe;EACnBtB,eAAeU,eAAe,EAAEV;EAChCY,eAAeF,eAAe,EAAEE;EAChCV;EACAqB,YAVsB5C,MAAMwB,iBAAiB;GAC7C,MAAMgB,iBAAiBT,eAAe,EAAEE;AACxC,UAAOO,iBACHC,QAAQnB,OAAOK,OAAOe,gBAAgBZ,MAAMU,gBAAgB,GAC5D;IACJ;EAMD;AAED,QAAAK,gBACG7C,MAAM8C,MAAI;EAAA,IAACC,OAAI;AAAA,UAAEhB,eAAe;;EAAAiB,WAC7BC,sBAAsB;GACtB,MAAMC,cACJ5B,OAAOa,WAAWc,mBAAmB,CAAChB;GAExC,MAAMkB,gCACJD,OAAO,CAACE,QAAQC,oBAChB/B,OAAO8B,Q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B,QAAQE;UAAuB,CAAA;;MAAA,IAAAN,WAAA;AAAA,cAAAH,gBAG3D1B,OAAK,EAAA,IAACE,UAAO;AAAA,eAAEmI,gBAAgB;UAAA,CAAA;;MAAA,CAAA;;IAAA,CAAA;;EAIvC,CAAA"}
1
+ {"version":3,"file":"Match.js","names":["Solid","createControlledPromise","getLocationChangeInfo","invariant","isNotFound","isRedirect","rootRouteId","isServer","Dynamic","CatchBoundary","ErrorComponent","useRouter","CatchNotFound","getNotFound","nearestMatchContext","SafeFragment","renderRouteNotFound","ScrollRestoration","AnyRoute","RootRouteOptions","Match","props","matchId","router","match","createMemo","id","undefined","stores","activeMatchStoresById","get","state","rawMatchState","currentMatch","routeId","parentRouteId","routesById","parentRoute","ssr","_displayPending","hasPendingMatch","currentRouteId","Boolean","pendingRouteIds","nearestMatch","hasPending","_$createComponent","Show","when","children","currentMatchState","route","resolvePendingComponent","options","pendingComponent","defaultPendingComponent","routeErrorComponent","errorComponent","defaultErrorComponent","routeOnCatch","onCatch","defaultOnCatch","routeNotFoundComponent","isRoot","notFoundComponent","notFoundRoute","component","resolvedNoSsr","ResolvedSuspenseBoundary","Suspense","ResolvedCatchBoundary","ResolvedNotFoundBoundary","ShellComponent","shellComponent","Provider","value","fallback","_$memo","getResetKey","loadedAt","error","Error","notFoundError","process","env","NODE_ENV","console","warn","_$mergeProps","Switch","MatchInner","OnRendered","scrollRestoration","location","resolvedLocation","__TSR_key","createEffect","on","emit","type","useContext","remountFn","remountDeps","defaultRemountDeps","loaderDeps","params","_strictParams","search","_strictSearch","key","JSON","stringify","status","_forcePending","componentKey","out","Comp","defaultComponent","Outlet","keyedOut","keyed","_key","_","displayPendingResult","createResource","getMatch","_nonReactive","displayPendingPromise","minPendingResult","minPendingPromise","pendingMinMs","defaultPendingMinMs","routerMatch","setTimeout","resolve","loaderResult","Promise","r","loadPromise","FallbackComponent","_routeId","RouteErrorComponent","info","componentStack","nearestParentMatch","parentMatch","parentGlobalNotFound","globalNotFound","childMatchId","childMatchIdByRouteId","childMatchStatus","shouldShowNotFound","resolvedRoute","childMatchIdAccessor","currentMatchId"],"sources":["../../src/Match.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport {\n createControlledPromise,\n getLocationChangeInfo,\n invariant,\n isNotFound,\n isRedirect,\n rootRouteId,\n} from '@tanstack/router-core'\nimport { isServer } from '@tanstack/router-core/isServer'\nimport { Dynamic } from 'solid-js/web'\nimport { CatchBoundary, ErrorComponent } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport { CatchNotFound, getNotFound } from './not-found'\nimport { nearestMatchContext } from './matchContext'\nimport { SafeFragment } from './SafeFragment'\nimport { renderRouteNotFound } from './renderRouteNotFound'\nimport { ScrollRestoration } from './scroll-restoration'\nimport type { AnyRoute, RootRouteOptions } from '@tanstack/router-core'\n\nexport const Match = (props: { matchId: string }) => {\n const router = useRouter()\n\n const match = Solid.createMemo(() => {\n const id = props.matchId\n if (!id) return undefined\n return router.stores.activeMatchStoresById.get(id)?.state\n })\n\n const rawMatchState = Solid.createMemo(() => {\n const currentMatch = match()\n if (!currentMatch) {\n return null\n }\n\n const routeId = currentMatch.routeId as string\n const parentRouteId = (router.routesById[routeId] as AnyRoute)?.parentRoute\n ?.id\n\n return {\n matchId: currentMatch.id,\n routeId,\n ssr: currentMatch.ssr,\n _displayPending: currentMatch._displayPending,\n parentRouteId: parentRouteId as string | undefined,\n }\n })\n\n const hasPendingMatch = Solid.createMemo(() => {\n const currentRouteId = rawMatchState()?.routeId\n return currentRouteId\n ? Boolean(router.stores.pendingRouteIds.state[currentRouteId])\n : false\n })\n const nearestMatch = {\n matchId: () => rawMatchState()?.matchId,\n routeId: () => rawMatchState()?.routeId,\n match,\n hasPending: hasPendingMatch,\n }\n\n return (\n <Solid.Show when={rawMatchState()}>\n {(currentMatchState) => {\n const route: () => AnyRoute = () =>\n router.routesById[currentMatchState().routeId]\n\n const resolvePendingComponent = () =>\n route().options.pendingComponent ??\n router.options.defaultPendingComponent\n\n const routeErrorComponent = () =>\n route().options.errorComponent ?? router.options.defaultErrorComponent\n\n const routeOnCatch = () =>\n route().options.onCatch ?? router.options.defaultOnCatch\n\n const routeNotFoundComponent = () =>\n route().isRoot\n ? // If it's the root route, use the globalNotFound option, with fallback to the notFoundRoute's component\n (route().options.notFoundComponent ??\n router.options.notFoundRoute?.options.component)\n : route().options.notFoundComponent\n\n const resolvedNoSsr =\n currentMatchState().ssr === false ||\n currentMatchState().ssr === 'data-only'\n\n const ResolvedSuspenseBoundary = () => Solid.Suspense\n\n const ResolvedCatchBoundary = () =>\n routeErrorComponent() ? CatchBoundary : SafeFragment\n\n const ResolvedNotFoundBoundary = () =>\n routeNotFoundComponent() ? CatchNotFound : SafeFragment\n\n const ShellComponent = route().isRoot\n ? ((route().options as RootRouteOptions).shellComponent ??\n SafeFragment)\n : SafeFragment\n\n return (\n <ShellComponent>\n <nearestMatchContext.Provider value={nearestMatch}>\n <Dynamic\n component={ResolvedSuspenseBoundary()}\n fallback={\n // Don't show fallback on server when using no-ssr mode to avoid hydration mismatch\n (isServer ?? router.isServer) && resolvedNoSsr ? undefined : (\n <Dynamic component={resolvePendingComponent()} />\n )\n }\n >\n <Dynamic\n component={ResolvedCatchBoundary()}\n getResetKey={() => router.stores.loadedAt.state}\n errorComponent={routeErrorComponent() || ErrorComponent}\n onCatch={(error: Error) => {\n // Forward not found errors (we don't want to show the error component for these)\n const notFoundError = getNotFound(error)\n if (notFoundError) {\n notFoundError.routeId ??= currentMatchState()\n .routeId as any\n throw notFoundError\n }\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `Warning: Error in route match: ${currentMatchState().routeId}`,\n )\n }\n routeOnCatch()?.(error)\n }}\n >\n <Dynamic\n component={ResolvedNotFoundBoundary()}\n fallback={(error: any) => {\n const notFoundError = getNotFound(error) ?? error\n\n notFoundError.routeId ??= currentMatchState()\n .routeId as any\n\n // If the current not found handler doesn't exist or it has a\n // route ID which doesn't match the current route, rethrow the error\n if (\n !routeNotFoundComponent() ||\n (notFoundError.routeId &&\n notFoundError.routeId !==\n currentMatchState().routeId) ||\n (!notFoundError.routeId && !route().isRoot)\n )\n throw notFoundError\n\n return (\n <Dynamic\n component={routeNotFoundComponent()}\n {...notFoundError}\n />\n )\n }}\n >\n <Solid.Switch>\n <Solid.Match when={resolvedNoSsr}>\n <Solid.Show\n when={!(isServer ?? router.isServer)}\n fallback={\n <Dynamic component={resolvePendingComponent()} />\n }\n >\n <MatchInner />\n </Solid.Show>\n </Solid.Match>\n <Solid.Match when={!resolvedNoSsr}>\n <MatchInner />\n </Solid.Match>\n </Solid.Switch>\n </Dynamic>\n </Dynamic>\n </Dynamic>\n </nearestMatchContext.Provider>\n\n {currentMatchState().parentRouteId === rootRouteId ? (\n <>\n <OnRendered />\n {router.options.scrollRestoration &&\n (isServer ?? router.isServer) ? (\n <ScrollRestoration />\n ) : null}\n </>\n ) : null}\n </ShellComponent>\n )\n }}\n </Solid.Show>\n )\n}\n\n// On Rendered can't happen above the root layout because it needs to run\n// after the app has committed below the root layout. Keeping it here lets us\n// fire onRendered even after a hydration mismatch above the root layout\n// (like bad head/link tags, which is common).\nfunction OnRendered() {\n const router = useRouter()\n\n const location = Solid.createMemo(\n () => router.stores.resolvedLocation.state?.state.__TSR_key,\n )\n Solid.createEffect(\n Solid.on([location], () => {\n router.emit({\n type: 'onRendered',\n ...getLocationChangeInfo(\n router.stores.location.state,\n router.stores.resolvedLocation.state,\n ),\n })\n }),\n )\n return null\n}\n\nexport const MatchInner = (): any => {\n const router = useRouter()\n const match = Solid.useContext(nearestMatchContext).match\n\n const rawMatchState = Solid.createMemo(() => {\n const currentMatch = match()\n if (!currentMatch) {\n return null\n }\n\n const routeId = currentMatch.routeId as string\n\n const remountFn =\n (router.routesById[routeId] as AnyRoute).options.remountDeps ??\n router.options.defaultRemountDeps\n const remountDeps = remountFn?.({\n routeId,\n loaderDeps: currentMatch.loaderDeps,\n params: currentMatch._strictParams,\n search: currentMatch._strictSearch,\n })\n const key = remountDeps ? JSON.stringify(remountDeps) : undefined\n\n return {\n key,\n routeId,\n match: {\n id: currentMatch.id,\n status: currentMatch.status,\n error: currentMatch.error,\n _forcePending: currentMatch._forcePending ?? false,\n _displayPending: currentMatch._displayPending ?? false,\n },\n }\n })\n\n return (\n <Solid.Show when={rawMatchState()}>\n {(currentMatchState) => {\n const route = () => router.routesById[currentMatchState().routeId]!\n\n const currentMatch = () => currentMatchState().match\n\n const componentKey = () =>\n currentMatchState().key ?? currentMatchState().match.id\n\n const out = () => {\n const Comp =\n route().options.component ?? router.options.defaultComponent\n if (Comp) {\n return <Comp />\n }\n return <Outlet />\n }\n\n const keyedOut = () => (\n <Solid.Show when={componentKey()} keyed>\n {(_key) => out()}\n </Solid.Show>\n )\n\n return (\n <Solid.Switch>\n <Solid.Match when={currentMatch()._displayPending}>\n {(_) => {\n const [displayPendingResult] = Solid.createResource(\n () =>\n router.getMatch(currentMatch().id)?._nonReactive\n .displayPendingPromise,\n )\n\n return <>{displayPendingResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch()._forcePending}>\n {(_) => {\n const [minPendingResult] = Solid.createResource(\n () =>\n router.getMatch(currentMatch().id)?._nonReactive\n .minPendingPromise,\n )\n\n return <>{minPendingResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'pending'}>\n {(_) => {\n const pendingMinMs =\n route().options.pendingMinMs ??\n router.options.defaultPendingMinMs\n\n if (pendingMinMs) {\n const routerMatch = router.getMatch(currentMatch().id)\n if (\n routerMatch &&\n !routerMatch._nonReactive.minPendingPromise\n ) {\n // Create a promise that will resolve after the minPendingMs\n if (!(isServer ?? router.isServer)) {\n const minPendingPromise = createControlledPromise<void>()\n\n routerMatch._nonReactive.minPendingPromise =\n minPendingPromise\n\n setTimeout(() => {\n minPendingPromise.resolve()\n // We've handled the minPendingPromise, so we can delete it\n routerMatch._nonReactive.minPendingPromise = undefined\n }, pendingMinMs)\n }\n }\n }\n\n const [loaderResult] = Solid.createResource(async () => {\n await new Promise((r) => setTimeout(r, 0))\n return router.getMatch(currentMatch().id)?._nonReactive\n .loadPromise\n })\n\n const FallbackComponent =\n route().options.pendingComponent ??\n router.options.defaultPendingComponent\n\n return (\n <>\n {FallbackComponent && pendingMinMs > 0 ? (\n <Dynamic component={FallbackComponent} />\n ) : null}\n {loaderResult()}\n </>\n )\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'notFound'}>\n {(_) => {\n if (!isNotFound(currentMatch().error)) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n 'Invariant failed: Expected a notFound error',\n )\n }\n\n invariant()\n }\n\n // Use Show with keyed to ensure re-render when routeId changes\n return (\n <Solid.Show when={currentMatchState().routeId} keyed>\n {(_routeId) =>\n renderRouteNotFound(router, route(), currentMatch().error)\n }\n </Solid.Show>\n )\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'redirected'}>\n {(_) => {\n if (!isRedirect(currentMatch().error)) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n 'Invariant failed: Expected a redirect error',\n )\n }\n\n invariant()\n }\n\n const [loaderResult] = Solid.createResource(async () => {\n await new Promise((r) => setTimeout(r, 0))\n return router.getMatch(currentMatch().id)?._nonReactive\n .loadPromise\n })\n\n return <>{loaderResult()}</>\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'error'}>\n {(_) => {\n if (isServer ?? router.isServer) {\n const RouteErrorComponent =\n (route().options.errorComponent ??\n router.options.defaultErrorComponent) ||\n ErrorComponent\n\n return (\n <RouteErrorComponent\n error={currentMatch().error}\n info={{\n componentStack: '',\n }}\n />\n )\n }\n\n throw currentMatch().error\n }}\n </Solid.Match>\n <Solid.Match when={currentMatch().status === 'success'}>\n {keyedOut()}\n </Solid.Match>\n </Solid.Switch>\n )\n }}\n </Solid.Show>\n )\n}\n\nexport const Outlet = () => {\n const router = useRouter()\n const nearestParentMatch = Solid.useContext(nearestMatchContext)\n const parentMatch = nearestParentMatch.match\n const routeId = nearestParentMatch.routeId\n const route = Solid.createMemo(() =>\n routeId() ? router.routesById[routeId()!] : undefined,\n )\n\n const parentGlobalNotFound = Solid.createMemo(\n () => parentMatch()?.globalNotFound ?? false,\n )\n\n const childMatchId = Solid.createMemo(() => {\n const currentRouteId = routeId()\n return currentRouteId\n ? router.stores.childMatchIdByRouteId.state[currentRouteId]\n : undefined\n })\n\n const childMatchStatus = Solid.createMemo(() => {\n const id = childMatchId()\n if (!id) return undefined\n return router.stores.activeMatchStoresById.get(id)?.state.status\n })\n\n // Only show not-found if we're not in a redirected state\n const shouldShowNotFound = () =>\n childMatchStatus() !== 'redirected' && parentGlobalNotFound()\n\n return (\n <Solid.Show\n when={!shouldShowNotFound() && childMatchId()}\n fallback={\n <Solid.Show when={shouldShowNotFound() && route()}>\n {(resolvedRoute) =>\n renderRouteNotFound(router, resolvedRoute(), undefined)\n }\n </Solid.Show>\n }\n >\n {(childMatchIdAccessor) => {\n const currentMatchId = Solid.createMemo(() => childMatchIdAccessor())\n\n return (\n <Solid.Show\n when={routeId() === rootRouteId}\n fallback={<Match matchId={currentMatchId()} />}\n >\n <Solid.Suspense\n fallback={\n <Dynamic component={router.options.defaultPendingComponent} />\n }\n >\n <Match matchId={currentMatchId()} />\n </Solid.Suspense>\n </Solid.Show>\n )\n }}\n </Solid.Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;AAoBA,IAAaoB,SAASC,UAA+B;CACnD,MAAME,SAASZ,WAAW;CAE1B,MAAMa,QAAQxB,MAAMyB,iBAAiB;EACnC,MAAMC,KAAKL,MAAMC;AACjB,MAAI,CAACI,GAAI,QAAOC,KAAAA;AAChB,SAAOJ,OAAOK,OAAOC,sBAAsBC,IAAIJ,GAAG,EAAEK;GACpD;CAEF,MAAMC,gBAAgBhC,MAAMyB,iBAAiB;EAC3C,MAAMQ,eAAeT,OAAO;AAC5B,MAAI,CAACS,aACH,QAAO;EAGT,MAAMC,UAAUD,aAAaC;EAC7B,MAAMC,gBAAiBZ,OA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C,MAAI;EAAA,IACTC,OAAI;AAAA,UAAE6B,WAAA,CAAA,CAAA,CAAC0E,oBAAoB,CAAA,EAAA,IAAIH,cAAc;;EAAA,IAC7CxE,WAAQ;AAAA,UAAA9B,gBACL9C,MAAM+C,MAAI;IAAA,IAACC,OAAI;AAAA,YAAE6B,WAAA,CAAA,CAAA0E,oBAAoB,CAAA,EAAA,IAAIpG,OAAO;;IAAAF,WAC7CuG,kBACAxI,oBAAoBO,QAAQiI,eAAe,EAAE7H,KAAAA,EAAS;IAAC,CAAA;;EAAAsB,WAK3DwG,yBAAyB;GACzB,MAAMC,iBAAiB1J,MAAMyB,iBAAiBgI,sBAAsB,CAAC;AAErE,UAAA3G,gBACG9C,MAAM+C,MAAI;IAAA,IACTC,OAAI;AAAA,YAAEd,SAAS,KAAK5B;;IAAW,IAC/BsE,WAAQ;AAAA,YAAA9B,gBAAG1B,OAAK,EAAA,IAACE,UAAO;AAAA,aAAEoI,gBAAgB;QAAA,CAAA;;IAAA,IAAAzG,WAAA;AAAA,YAAAH,gBAEzC9C,MAAMqE,UAAQ;MAAA,IACbO,WAAQ;AAAA,cAAA9B,gBACLtC,SAAO,EAAA,IAAC0D,YAAS;AAAA,eAAE3C,OAAO8B,QAAQE;UAAuB,CAAA;;MAAA,IAAAN,WAAA;AAAA,cAAAH,gBAG3D1B,OAAK,EAAA,IAACE,UAAO;AAAA,eAAEoI,gBAAgB;UAAA,CAAA;;MAAA,CAAA;;IAAA,CAAA;;EAIvC,CAAA"}
@@ -1,8 +1,11 @@
1
1
  import { NotFoundError } from '@tanstack/router-core';
2
2
  import * as Solid from 'solid-js';
3
+ export declare function getNotFound(error: unknown): (NotFoundError & {
4
+ isNotFound: true;
5
+ }) | undefined;
3
6
  export declare function CatchNotFound(props: {
4
7
  fallback?: (error: NotFoundError) => Solid.JSX.Element;
5
- onCatch?: (error: Error) => void;
8
+ onCatch?: (error: NotFoundError) => void;
6
9
  children: Solid.JSX.Element;
7
10
  }): Solid.JSX.Element;
8
11
  export declare function DefaultGlobalNotFound(): Solid.JSX.Element;
@@ -5,6 +5,10 @@ import { createComponent, template } from "solid-js/web";
5
5
  import * as Solid from "solid-js";
6
6
  //#region src/not-found.tsx
7
7
  var _tmpl$ = /* @__PURE__ */ template(`<p>Not Found`);
8
+ function getNotFound(error) {
9
+ if (isNotFound(error)) return error;
10
+ if (isNotFound(error?.cause)) return error.cause;
11
+ }
8
12
  function CatchNotFound(props) {
9
13
  const router = useRouter();
10
14
  const pathname = Solid.createMemo(() => router.stores.location.state.pathname);
@@ -12,11 +16,13 @@ function CatchNotFound(props) {
12
16
  return createComponent(CatchBoundary, {
13
17
  getResetKey: () => `not-found-${pathname()}-${status()}`,
14
18
  onCatch: (error) => {
15
- if (isNotFound(error)) props.onCatch?.(error);
19
+ const notFoundError = getNotFound(error);
20
+ if (notFoundError) props.onCatch?.(notFoundError);
16
21
  else throw error;
17
22
  },
18
23
  errorComponent: ({ error }) => {
19
- if (isNotFound(error)) return props.fallback?.(error);
24
+ const notFoundError = getNotFound(error);
25
+ if (notFoundError) return props.fallback?.(notFoundError);
20
26
  else throw error;
21
27
  },
22
28
  get children() {
@@ -28,6 +34,6 @@ function DefaultGlobalNotFound() {
28
34
  return _tmpl$();
29
35
  }
30
36
  //#endregion
31
- export { CatchNotFound, DefaultGlobalNotFound };
37
+ export { CatchNotFound, DefaultGlobalNotFound, getNotFound };
32
38
 
33
39
  //# sourceMappingURL=not-found.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"not-found.js","names":["isNotFound","Solid","CatchBoundary","useRouter","NotFoundError","CatchNotFound","props","fallback","error","JSX","Element","onCatch","Error","children","router","pathname","createMemo","stores","location","state","status","_$createComponent","getResetKey","errorComponent","DefaultGlobalNotFound","_tmpl$"],"sources":["../../src/not-found.tsx"],"sourcesContent":["import { isNotFound } from '@tanstack/router-core'\nimport * as Solid from 'solid-js'\nimport { CatchBoundary } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport type { NotFoundError } from '@tanstack/router-core'\n\nexport function CatchNotFound(props: {\n fallback?: (error: NotFoundError) => Solid.JSX.Element\n onCatch?: (error: Error) => void\n children: Solid.JSX.Element\n}) {\n const router = useRouter()\n // TODO: Some way for the user to programmatically reset the not-found boundary?\n const pathname = Solid.createMemo(() => router.stores.location.state.pathname)\n const status = Solid.createMemo(() => router.stores.status.state)\n\n return (\n <CatchBoundary\n getResetKey={() => `not-found-${pathname()}-${status()}`}\n onCatch={(error) => {\n if (isNotFound(error)) {\n props.onCatch?.(error)\n } else {\n throw error\n }\n }}\n errorComponent={({ error }) => {\n if (isNotFound(error)) {\n return props.fallback?.(error)\n } else {\n throw error\n }\n }}\n >\n {props.children}\n </CatchBoundary>\n )\n}\n\nexport function DefaultGlobalNotFound() {\n return <p>Not Found</p>\n}\n"],"mappings":";;;;;;;AAMA,SAAgBK,cAAcC,OAI3B;CACD,MAAMQ,SAASX,WAAW;CAE1B,MAAMY,WAAWd,MAAMe,iBAAiBF,OAAOG,OAAOC,SAASC,MAAMJ,SAAS;CAC9E,MAAMK,SAASnB,MAAMe,iBAAiBF,OAAOG,OAAOG,OAAOD,MAAM;AAEjE,QAAAE,gBACGnB,eAAa;EACZoB,mBAAmB,aAAaP,UAAU,CAAA,GAAIK,QAAQ;EACtDT,UAAUH,UAAU;AAClB,OAAIR,WAAWQ,MAAM,CACnBF,OAAMK,UAAUH,MAAM;OAEtB,OAAMA;;EAGVe,iBAAiB,EAAEf,YAAY;AAC7B,OAAIR,WAAWQ,MAAM,CACnB,QAAOF,MAAMC,WAAWC,MAAM;OAE9B,OAAMA;;EAET,IAAAK,WAAA;AAAA,UAEAP,MAAMO;;EAAQ,CAAA;;AAKrB,SAAgBW,wBAAwB;AACtC,QAAAC,QAAA"}
1
+ {"version":3,"file":"not-found.js","names":["isNotFound","Solid","CatchBoundary","useRouter","NotFoundError","getNotFound","error","cause","undefined","CatchNotFound","props","fallback","JSX","Element","onCatch","children","router","pathname","createMemo","stores","location","state","status","_$createComponent","getResetKey","notFoundError","errorComponent","DefaultGlobalNotFound","_tmpl$"],"sources":["../../src/not-found.tsx"],"sourcesContent":["import { isNotFound } from '@tanstack/router-core'\nimport * as Solid from 'solid-js'\nimport { CatchBoundary } from './CatchBoundary'\nimport { useRouter } from './useRouter'\nimport type { NotFoundError } from '@tanstack/router-core'\n\n// Solid wraps non-Error throws in an Error and stores the original thrown value\n// on `cause`, so component-thrown `notFound()` needs one extra unwrapping step.\nexport function getNotFound(\n error: unknown,\n): (NotFoundError & { isNotFound: true }) | undefined {\n if (isNotFound(error)) {\n return error as NotFoundError & { isNotFound: true }\n }\n\n if (isNotFound((error as any)?.cause)) {\n return (error as any).cause as NotFoundError & { isNotFound: true }\n }\n\n return undefined\n}\n\nexport function CatchNotFound(props: {\n fallback?: (error: NotFoundError) => Solid.JSX.Element\n onCatch?: (error: NotFoundError) => void\n children: Solid.JSX.Element\n}) {\n const router = useRouter()\n // TODO: Some way for the user to programmatically reset the not-found boundary?\n const pathname = Solid.createMemo(() => router.stores.location.state.pathname)\n const status = Solid.createMemo(() => router.stores.status.state)\n\n return (\n <CatchBoundary\n getResetKey={() => `not-found-${pathname()}-${status()}`}\n onCatch={(error) => {\n const notFoundError = getNotFound(error)\n\n if (notFoundError) {\n props.onCatch?.(notFoundError)\n } else {\n throw error\n }\n }}\n errorComponent={({ error }) => {\n const notFoundError = getNotFound(error)\n\n if (notFoundError) {\n return props.fallback?.(notFoundError)\n } else {\n throw error\n }\n }}\n >\n {props.children}\n </CatchBoundary>\n )\n}\n\nexport function DefaultGlobalNotFound() {\n return <p>Not Found</p>\n}\n"],"mappings":";;;;;;;AAQA,SAAgBK,YACdC,OACoD;AACpD,KAAIN,WAAWM,MAAM,CACnB,QAAOA;AAGT,KAAIN,WAAYM,OAAeC,MAAM,CACnC,QAAQD,MAAcC;;AAM1B,SAAgBE,cAAcC,OAI3B;CACD,MAAMM,SAASb,WAAW;CAE1B,MAAMc,WAAWhB,MAAMiB,iBAAiBF,OAAOG,OAAOC,SAASC,MAAMJ,SAAS;CAC9E,MAAMK,SAASrB,MAAMiB,iBAAiBF,OAAOG,OAAOG,OAAOD,MAAM;AAEjE,QAAAE,gBACGrB,eAAa;EACZsB,mBAAmB,aAAaP,UAAU,CAAA,GAAIK,QAAQ;EACtDR,UAAUR,UAAU;GAClB,MAAMmB,gBAAgBpB,YAAYC,MAAM;AAExC,OAAImB,cACFf,OAAMI,UAAUW,cAAc;OAE9B,OAAMnB;;EAGVoB,iBAAiB,EAAEpB,YAAY;GAC7B,MAAMmB,gBAAgBpB,YAAYC,MAAM;AAExC,OAAImB,cACF,QAAOf,MAAMC,WAAWc,cAAc;OAEtC,OAAMnB;;EAET,IAAAS,WAAA;AAAA,UAEAL,MAAMK;;EAAQ,CAAA;;AAKrB,SAAgBY,wBAAwB;AACtC,QAAAC,QAAA"}
@@ -4,7 +4,7 @@ import { isServer } from '@tanstack/router-core/isServer';
4
4
  import { Dynamic } from 'solid-js/web';
5
5
  import { CatchBoundary, ErrorComponent } from './CatchBoundary';
6
6
  import { useRouter } from './useRouter';
7
- import { CatchNotFound } from './not-found';
7
+ import { CatchNotFound, getNotFound } from './not-found';
8
8
  import { nearestMatchContext } from './matchContext';
9
9
  import { SafeFragment } from './SafeFragment';
10
10
  import { renderRouteNotFound } from './renderRouteNotFound';
@@ -73,22 +73,30 @@ export const Match = (props) => {
73
73
  (isServer ?? router.isServer) && resolvedNoSsr ? undefined : (<Dynamic component={resolvePendingComponent()}/>)}>
74
74
  <Dynamic component={ResolvedCatchBoundary()} getResetKey={() => router.stores.loadedAt.state} errorComponent={routeErrorComponent() || ErrorComponent} onCatch={(error) => {
75
75
  // Forward not found errors (we don't want to show the error component for these)
76
- if (isNotFound(error))
77
- throw error;
76
+ const notFoundError = getNotFound(error);
77
+ if (notFoundError) {
78
+ notFoundError.routeId ?? (notFoundError.routeId = currentMatchState()
79
+ .routeId);
80
+ throw notFoundError;
81
+ }
78
82
  if (process.env.NODE_ENV !== 'production') {
79
83
  console.warn(`Warning: Error in route match: ${currentMatchState().routeId}`);
80
84
  }
81
85
  routeOnCatch()?.(error);
82
86
  }}>
83
87
  <Dynamic component={ResolvedNotFoundBoundary()} fallback={(error) => {
88
+ const notFoundError = getNotFound(error) ?? error;
89
+ notFoundError.routeId ?? (notFoundError.routeId = currentMatchState()
90
+ .routeId);
84
91
  // If the current not found handler doesn't exist or it has a
85
92
  // route ID which doesn't match the current route, rethrow the error
86
93
  if (!routeNotFoundComponent() ||
87
- (error.routeId &&
88
- error.routeId !== currentMatchState().routeId) ||
89
- (!error.routeId && !route().isRoot))
90
- throw error;
91
- return (<Dynamic component={routeNotFoundComponent()} {...error}/>);
94
+ (notFoundError.routeId &&
95
+ notFoundError.routeId !==
96
+ currentMatchState().routeId) ||
97
+ (!notFoundError.routeId && !route().isRoot))
98
+ throw notFoundError;
99
+ return (<Dynamic component={routeNotFoundComponent()} {...notFoundError}/>);
92
100
  }}>
93
101
  <Solid.Switch>
94
102
  <Solid.Match when={resolvedNoSsr}>
@@ -1 +1 @@
1
- {"version":3,"file":"Match.jsx","sourceRoot":"","sources":["../../src/Match.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AACjC,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,SAAS,EACT,UAAU,EACV,UAAU,EACV,WAAW,GACZ,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAA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router-core';
3
+ export declare function getNotFound(error: unknown): (NotFoundError & {
4
+ isNotFound: true;
5
+ }) | undefined;
3
6
  export declare function CatchNotFound(props: {
4
7
  fallback?: (error: NotFoundError) => Solid.JSX.Element;
5
- onCatch?: (error: Error) => void;
8
+ onCatch?: (error: NotFoundError) => void;
6
9
  children: Solid.JSX.Element;
7
10
  }): Solid.JSX.Element;
8
11
  export declare function DefaultGlobalNotFound(): Solid.JSX.Element;
@@ -2,21 +2,34 @@ import { isNotFound } from '@tanstack/router-core';
2
2
  import * as Solid from 'solid-js';
3
3
  import { CatchBoundary } from './CatchBoundary';
4
4
  import { useRouter } from './useRouter';
5
+ // Solid wraps non-Error throws in an Error and stores the original thrown value
6
+ // on `cause`, so component-thrown `notFound()` needs one extra unwrapping step.
7
+ export function getNotFound(error) {
8
+ if (isNotFound(error)) {
9
+ return error;
10
+ }
11
+ if (isNotFound(error?.cause)) {
12
+ return error.cause;
13
+ }
14
+ return undefined;
15
+ }
5
16
  export function CatchNotFound(props) {
6
17
  const router = useRouter();
7
18
  // TODO: Some way for the user to programmatically reset the not-found boundary?
8
19
  const pathname = Solid.createMemo(() => router.stores.location.state.pathname);
9
20
  const status = Solid.createMemo(() => router.stores.status.state);
10
21
  return (<CatchBoundary getResetKey={() => `not-found-${pathname()}-${status()}`} onCatch={(error) => {
11
- if (isNotFound(error)) {
12
- props.onCatch?.(error);
22
+ const notFoundError = getNotFound(error);
23
+ if (notFoundError) {
24
+ props.onCatch?.(notFoundError);
13
25
  }
14
26
  else {
15
27
  throw error;
16
28
  }
17
29
  }} errorComponent={({ error }) => {
18
- if (isNotFound(error)) {
19
- return props.fallback?.(error);
30
+ const notFoundError = getNotFound(error);
31
+ if (notFoundError) {
32
+ return props.fallback?.(notFoundError);
20
33
  }
21
34
  else {
22
35
  throw error;
@@ -1 +1 @@
1
- {"version":3,"file":"not-found.jsx","sourceRoot":"","sources":["../../src/not-found.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE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AC;gBAClB,KAAK,CAAC,OAAO,EAAE,CAAC,aAAa,CAAC,CAAA;YAChC,CAAC;iBAAM,CAAC;gBACN,MAAM,KAAK,CAAA;YACb,CAAC;QACH,CAAC,CAAC,CACF,cAAc,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;YAC5B,MAAM,aAAa,GAAG,WAAW,CAAC,KAAK,CAAC,CAAA;YAExC,IAAI,aAAa,EAAE,CAAC;gBAClB,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC,aAAa,CAAC,CAAA;YACxC,CAAC;iBAAM,CAAC;gBACN,MAAM,KAAK,CAAA;YACb,CAAC;QACH,CAAC,CAAC,CAEF;MAAA,CAAC,KAAK,CAAC,QAAQ,CACjB;IAAA,EAAE,aAAa,CAAC,CACjB,CAAA;AACH,CAAC;AAED,MAAM,UAAU,qBAAqB;IACnC,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAA;AACzB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/solid-router",
3
- "version": "1.168.8",
3
+ "version": "1.168.9",
4
4
  "description": "Modern and scalable routing for Solid applications",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -92,7 +92,7 @@
92
92
  "@solidjs/meta": "^0.29.4",
93
93
  "isbot": "^5.1.22",
94
94
  "@tanstack/history": "1.161.6",
95
- "@tanstack/router-core": "1.168.8"
95
+ "@tanstack/router-core": "1.168.9"
96
96
  },
97
97
  "devDependencies": {
98
98
  "@solidjs/testing-library": "^0.8.10",
package/src/Match.tsx CHANGED
@@ -11,7 +11,7 @@ import { isServer } from '@tanstack/router-core/isServer'
11
11
  import { Dynamic } from 'solid-js/web'
12
12
  import { CatchBoundary, ErrorComponent } from './CatchBoundary'
13
13
  import { useRouter } from './useRouter'
14
- import { CatchNotFound } from './not-found'
14
+ import { CatchNotFound, getNotFound } from './not-found'
15
15
  import { nearestMatchContext } from './matchContext'
16
16
  import { SafeFragment } from './SafeFragment'
17
17
  import { renderRouteNotFound } from './renderRouteNotFound'
@@ -117,7 +117,12 @@ export const Match = (props: { matchId: string }) => {
117
117
  errorComponent={routeErrorComponent() || ErrorComponent}
118
118
  onCatch={(error: Error) => {
119
119
  // Forward not found errors (we don't want to show the error component for these)
120
- if (isNotFound(error)) throw error
120
+ const notFoundError = getNotFound(error)
121
+ if (notFoundError) {
122
+ notFoundError.routeId ??= currentMatchState()
123
+ .routeId as any
124
+ throw notFoundError
125
+ }
121
126
  if (process.env.NODE_ENV !== 'production') {
122
127
  console.warn(
123
128
  `Warning: Error in route match: ${currentMatchState().routeId}`,
@@ -129,20 +134,26 @@ export const Match = (props: { matchId: string }) => {
129
134
  <Dynamic
130
135
  component={ResolvedNotFoundBoundary()}
131
136
  fallback={(error: any) => {
137
+ const notFoundError = getNotFound(error) ?? error
138
+
139
+ notFoundError.routeId ??= currentMatchState()
140
+ .routeId as any
141
+
132
142
  // If the current not found handler doesn't exist or it has a
133
143
  // route ID which doesn't match the current route, rethrow the error
134
144
  if (
135
145
  !routeNotFoundComponent() ||
136
- (error.routeId &&
137
- error.routeId !== currentMatchState().routeId) ||
138
- (!error.routeId && !route().isRoot)
146
+ (notFoundError.routeId &&
147
+ notFoundError.routeId !==
148
+ currentMatchState().routeId) ||
149
+ (!notFoundError.routeId && !route().isRoot)
139
150
  )
140
- throw error
151
+ throw notFoundError
141
152
 
142
153
  return (
143
154
  <Dynamic
144
155
  component={routeNotFoundComponent()}
145
- {...error}
156
+ {...notFoundError}
146
157
  />
147
158
  )
148
159
  }}
package/src/not-found.tsx CHANGED
@@ -4,9 +4,25 @@ import { CatchBoundary } from './CatchBoundary'
4
4
  import { useRouter } from './useRouter'
5
5
  import type { NotFoundError } from '@tanstack/router-core'
6
6
 
7
+ // Solid wraps non-Error throws in an Error and stores the original thrown value
8
+ // on `cause`, so component-thrown `notFound()` needs one extra unwrapping step.
9
+ export function getNotFound(
10
+ error: unknown,
11
+ ): (NotFoundError & { isNotFound: true }) | undefined {
12
+ if (isNotFound(error)) {
13
+ return error as NotFoundError & { isNotFound: true }
14
+ }
15
+
16
+ if (isNotFound((error as any)?.cause)) {
17
+ return (error as any).cause as NotFoundError & { isNotFound: true }
18
+ }
19
+
20
+ return undefined
21
+ }
22
+
7
23
  export function CatchNotFound(props: {
8
24
  fallback?: (error: NotFoundError) => Solid.JSX.Element
9
- onCatch?: (error: Error) => void
25
+ onCatch?: (error: NotFoundError) => void
10
26
  children: Solid.JSX.Element
11
27
  }) {
12
28
  const router = useRouter()
@@ -18,15 +34,19 @@ export function CatchNotFound(props: {
18
34
  <CatchBoundary
19
35
  getResetKey={() => `not-found-${pathname()}-${status()}`}
20
36
  onCatch={(error) => {
21
- if (isNotFound(error)) {
22
- props.onCatch?.(error)
37
+ const notFoundError = getNotFound(error)
38
+
39
+ if (notFoundError) {
40
+ props.onCatch?.(notFoundError)
23
41
  } else {
24
42
  throw error
25
43
  }
26
44
  }}
27
45
  errorComponent={({ error }) => {
28
- if (isNotFound(error)) {
29
- return props.fallback?.(error)
46
+ const notFoundError = getNotFound(error)
47
+
48
+ if (notFoundError) {
49
+ return props.fallback?.(notFoundError)
30
50
  } else {
31
51
  throw error
32
52
  }