Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fifty-dots-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@builder.io/qwik-city': patch
---

Fix: SSG sometimes hangs after completion, now we forcibly exit the SSG process when this happens.
28 changes: 28 additions & 0 deletions packages/qwik-city/src/adapters/shared/vite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,34 @@ export function viteAdapter(opts: ViteAdapterPluginOptions) {
`\n==============================================`
);
}
if (opts.ssg !== null) {
/**
* HACK: for some reason the build hangs after SSG. `why-is-node-running` shows 4
* culprits:
*
* ```
* There are 4 handle(s) keeping the process running.
*
* # CustomGC
* ./node_modules/.pnpm/[email protected]/node_modules/lightningcss/node/index.js:20 - module.exports = require(`lightningcss-${parts.join('-')}`);
*
* # CustomGC
* ./node_modules/.pnpm/@[email protected]/node_modules/@tailwindcss/oxide/index.js:229 - return require('@tailwindcss/oxide-linux-x64-gnu')
*
* # Timeout
* node_modules/.vite-temp/vite.config.timestamp-1755270314169-a2a97ad5233f9.mjs:357
* ./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;
*
* # CustomGC
* ./packages/qwik/dist/optimizer.mjs:1328 - const mod2 = module.default.createRequire(import.meta.url)(`../bindings/${triple.platformArchABI}`);
* ```
*
* For now, we'll force exit the process after SSG with some delay.
*/
setTimeout(() => {
process.exit(0);
}, 5000).unref();
}
}
},
},
Expand Down
Loading