MCPcopy Create free account
hub / github.com/TanStack/router / isModuleNotFoundError

Function isModuleNotFoundError

packages/router-core/src/utils.ts:492–502  ·  view source on GitHub ↗
(error: any)

Source from the content-addressed store, hash-verified

490 * across major browsers for lazy route component handling.
491 */
492export function isModuleNotFoundError(error: any): boolean {
493 // chrome: "Failed to fetch dynamically imported module: http://localhost:5173/src/routes/posts.index.tsx?tsr-split"
494 // firefox: "error loading dynamically imported module: http://localhost:5173/src/routes/posts.index.tsx?tsr-split"
495 // safari: "Importing a module script failed."
496 if (typeof error?.message !== 'string') return false
497 return (
498 error.message.startsWith('Failed to fetch dynamically imported module') ||
499 error.message.startsWith('error loading dynamically imported module') ||
500 error.message.startsWith('Importing a module script failed')
501 )
502}
503
504export function isPromise<T>(
505 value: Promise<Awaited<T>> | T,

Callers 2

lazyCompFunction · 0.90
loadFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected