Skip to content

Commit

Permalink
Fix loading loaders on resolveStart
Browse files Browse the repository at this point in the history
Signed-off-by: Marcos Candeia <[email protected]>
  • Loading branch information
mcandeia committed Jul 24, 2024
1 parent 433d54d commit f863827
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions website/sections/Rendering/Lazy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ export const loader = async (props: Props, req: Request, ctx: AppContext) => {
? await section({}, {
propagateOptions: true,
hooks: {
onResolveStart: (resolve, _props, resolver, _resolveType, ctx) => {
if (resolvingMatchers[ctx.resolveId]) {
return resolve();
}
if (resolver.type === "loaders") {
// deno-lint-ignore no-explicit-any
return undefined as any;
}
return resolve();
},
onPropsResolveStart: (
resolve,
_props,
Expand All @@ -99,10 +109,6 @@ export const loader = async (props: Props, req: Request, ctx: AppContext) => {
resolvingMatchers[id] = true;
return resolve(id);
}
if (resolver?.type === "loaders") {
// deno-lint-ignore no-explicit-any
return undefined as any;
}
return resolve();
},
},
Expand Down

0 comments on commit f863827

Please sign in to comment.