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

Function isModuleNotFoundError

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

Source from the content-addressed store, hash-verified

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

Callers 2

lazyCompFunction · 0.90
lazyCompFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected