Skip to content

Commit 819b99a

Browse files
committed
chore: type error after RR 7.5. this is why we make PRs
1 parent c1134cf commit 819b99a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/util/path-builder.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,13 @@ test('path builder', () => {
123123
const getMatches = (pathname: string) =>
124124
Promise.all(
125125
matchRoutes(routes, pathname)!.map(async (m) => {
126+
// lazy can also be an object as of RR 7.5, but we never use it that way
127+
const lazy = typeof m.route.lazy === 'function' ? m.route.lazy : undefined
126128
// As we convert route modules to RR framework mode with lazy imports,
127129
// more and more of the routes will have their handles defined inside the
128130
// route module. We need to call the lazy function to import the module
129131
// contents and fill out the route object with it.
130-
const route = { ...m.route, ...(await m.route.lazy?.()) }
132+
const route = { ...m.route, ...(await lazy?.()) }
131133
return {
132134
pathname: m.pathname,
133135
params: m.params,

0 commit comments

Comments
 (0)