Skip to content

Commit 5453cd4

Browse files
committed
fix(ssg): workaround for hanging after ssg
1 parent dc4560b commit 5453cd4

File tree

1 file changed

+28
-0
lines changed
  • packages/qwik-router/src/adapters/shared/vite

1 file changed

+28
-0
lines changed

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,34 @@ export function viteAdapter(opts: ViteAdapterPluginOptions) {
195195
`\nSee https://qwik.dev/docs/deployments/#cache-headers for more information.` +
196196
`\n==============================================`
197197
);
198+
if (opts.ssg !== null) {
199+
/**
200+
* HACK: for some reason the build hangs after SSG. `why-is-node-running` shows 4
201+
* culprits:
202+
*
203+
* ```
204+
* There are 4 handle(s) keeping the process running.
205+
*
206+
* # CustomGC
207+
* ./node_modules/.pnpm/[email protected]/node_modules/lightningcss/node/index.js:20 - module.exports = require(`lightningcss-${parts.join('-')}`);
208+
*
209+
* # CustomGC
210+
* ./node_modules/.pnpm/@[email protected]/node_modules/@tailwindcss/oxide/index.js:229 - return require('@tailwindcss/oxide-linux-x64-gnu')
211+
*
212+
* # Timeout
213+
* node_modules/.vite-temp/vite.config.timestamp-1755270314169-a2a97ad5233f9.mjs:357
214+
* ./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;
215+
*
216+
* # CustomGC
217+
* ./packages/qwik/dist/optimizer.mjs:1328 - const mod2 = module.default.createRequire(import.meta.url)(`../bindings/${triple.platformArchABI}`);
218+
* ```
219+
*
220+
* For now, we'll force exit the process after SSG with some delay.
221+
*/
222+
setTimeout(() => {
223+
process.exit(0);
224+
}, 5000).unref();
225+
}
198226
}
199227
},
200228
},

0 commit comments

Comments
 (0)