Skip to content

Commit

Permalink
fix(optimizer): ignore unknown deps in graph
Browse files Browse the repository at this point in the history
  • Loading branch information
wmertens committed Sep 18, 2024
1 parent a9ee2a6 commit 75a6223
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/quiet-grapes-sit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@builder.io/qwik': patch
---

fix(optimizer): ignore unknown deps in graph causing crashes during build
6 changes: 3 additions & 3 deletions e2e/qwik-cli-e2e/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "qwik-cli-e2e",
"dependencies": {
"kleur": "4.1.5"
},
"private": true,
"scripts": {
"e2e": "vitest run --config=vite.config.ts",
"e2e:watch": "vitest watch --config=vite.config.ts"
},
"dependencies": {
"kleur": "4.1.5"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@
"serve.debug": "tsm --inspect-brk --conditions=development starters/dev-server.ts 3300",
"start": "concurrently \"npm:build.watch\" \"npm:tsc.watch\" -n build,tsc -c green,cyan",
"test": "pnpm build.full && pnpm test.unit && pnpm test.e2e",
"test.e2e-cli": "pnpm --filter qwik-cli-e2e e2e",
"test.e2e": "pnpm test.e2e.chromium && pnpm test.e2e.webkit",
"test.e2e-cli": "pnpm --filter qwik-cli-e2e e2e",
"test.e2e.chromium": "playwright test starters --browser=chromium --config starters/playwright.config.ts",
"test.e2e.chromium.debug": "PWDEBUG=1 playwright test starters --browser=chromium --config starters/playwright.config.ts",
"test.e2e.city": "playwright test starters/e2e/qwikcity --browser=chromium --config starters/playwright.config.ts",
Expand Down
4 changes: 4 additions & 0 deletions packages/qwik/src/optimizer/src/plugins/vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,10 @@ export function convertManifestToBundleGraph(manifest: QwikManifest): QwikBundle
const map = new Map<string, { index: number; deps: Set<string> }>();
const clearTransitiveDeps = (parentDeps: Set<string>, seen: Set<string>, bundleName: string) => {
const bundle = graph[bundleName];
if (!bundle) {
// weird but ok
return;
}
for (const dep of bundle.imports || []) {
if (parentDeps.has(dep)) {
parentDeps.delete(dep);
Expand Down

0 comments on commit 75a6223

Please sign in to comment.