Skip to content

Commit 8395737

Browse files
committed
fix(preloader): clean initial qrl symbols
1 parent 6389902 commit 8395737

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

packages/qwik/src/server/prefetch-strategy.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,14 @@ export function getPreloadPaths(
4848
}
4949

5050
// If we have a bundle graph, all we need is the symbols
51-
return (snapshotResult?.qrls as QRLInternal[])
52-
?.map((qrl) => getSymbolHash(qrl.$refSymbol$ || qrl.$symbol$))
53-
.filter(Boolean) as string[];
51+
const symbols = new Set<string>();
52+
for (const qrl of (snapshotResult?.qrls || []) as QRLInternal[]) {
53+
const symbol = getSymbolHash(qrl.$refSymbol$ || qrl.$symbol$);
54+
if (symbol && symbol.length >= 10) {
55+
symbols.add(symbol);
56+
}
57+
}
58+
return [...symbols];
5459
}
5560

5661
export const expandBundles = (names: string[], resolvedManifest?: ResolvedManifest) => {

0 commit comments

Comments
 (0)