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

Function isModuleNotFoundError

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

Source from the content-addressed store, hash-verified

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

Callers 2

renderFunction · 0.90
lazyCompFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected