Skip to content

Commit 447bd9d

Browse files
authored
Merge branch 'main' into fix/5068
2 parents 4e39ee7 + d1b2642 commit 447bd9d

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

.changeset/fifty-dots-wonder.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@builder.io/qwik-city': patch
3+
---
4+
5+
Fix: SSG sometimes hangs after completion, now we forcibly exit the SSG process when this happens.

packages/qwik-city/src/adapters/shared/vite/index.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,34 @@ export function viteAdapter(opts: ViteAdapterPluginOptions) {
202202
`\n==============================================`
203203
);
204204
}
205+
if (opts.ssg !== null) {
206+
/**
207+
* HACK: for some reason the build hangs after SSG. `why-is-node-running` shows 4
208+
* culprits:
209+
*
210+
* ```
211+
* There are 4 handle(s) keeping the process running.
212+
*
213+
* # CustomGC
214+
* ./node_modules/.pnpm/[email protected]/node_modules/lightningcss/node/index.js:20 - module.exports = require(`lightningcss-${parts.join('-')}`);
215+
*
216+
* # CustomGC
217+
* ./node_modules/.pnpm/@[email protected]/node_modules/@tailwindcss/oxide/index.js:229 - return require('@tailwindcss/oxide-linux-x64-gnu')
218+
*
219+
* # Timeout
220+
* node_modules/.vite-temp/vite.config.timestamp-1755270314169-a2a97ad5233f9.mjs:357
221+
* ./node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected][email protected]/node_modules/vite/dist/node/chunks/dep-CMEinpL-.js:36657 - return (await import(pathToFileURL(tempFileName).href)).default;
222+
*
223+
* # CustomGC
224+
* ./packages/qwik/dist/optimizer.mjs:1328 - const mod2 = module.default.createRequire(import.meta.url)(`../bindings/${triple.platformArchABI}`);
225+
* ```
226+
*
227+
* For now, we'll force exit the process after SSG with some delay.
228+
*/
229+
setTimeout(() => {
230+
process.exit(0);
231+
}, 5000).unref();
232+
}
205233
}
206234
},
207235
},

0 commit comments

Comments
 (0)