fix: router lazy promise error

This commit is contained in:
DIYgod
2025-03-30 16:53:18 +08:00
parent b75dd12d51
commit ee6546897d
+1 -2
View File
@@ -1,5 +1,4 @@
import { get, omit } from "es-toolkit/compat"
import { Fragment } from "react/jsx-runtime"
import type { RouteObject } from "react-router"
type NestedStructure = { [key: string]: NestedStructure }
@@ -85,7 +84,7 @@ export function buildGlobRoutes(glob: Record<string, () => Promise<any>>): Route
if (isGroupedRoute) {
const accessPath = `${segmentPathKey}/layout.tsx`
const globGetter = get(glob, accessPath) || (() => Fragment)
const globGetter = get(glob, accessPath) || undefined
if (pathGetterSet.has(accessPath)) {
// throw new Error(`duplicate path: ` + accessPath)