Builds errors bugfix
This commit is contained in:
+11
-1
@@ -1,9 +1,10 @@
|
||||
import * as esbuild from "esbuild";
|
||||
/**
|
||||
* Disposes the hydration and SSR esbuild contexts, releasing the incremental
|
||||
* build state esbuild keeps in memory for them. The bundlers re-create the
|
||||
* contexts on their next run.
|
||||
*/
|
||||
export default async function disposeBundlerContexts() {
|
||||
export default async function disposeBundlerContexts(params) {
|
||||
try {
|
||||
await global.BUNEXT_BUNDLER_CTX?.dispose();
|
||||
}
|
||||
@@ -14,4 +15,13 @@ export default async function disposeBundlerContexts() {
|
||||
}
|
||||
catch (error) { }
|
||||
global.BUNEXT_SSR_BUNDLER_CTX = undefined;
|
||||
if (params?.stop_service) {
|
||||
// Exiting while the service is still running can leave it orphaned
|
||||
// with an unanswered ping, which crashes it with "all goroutines are
|
||||
// asleep - deadlock!".
|
||||
try {
|
||||
await esbuild.stop();
|
||||
}
|
||||
catch (error) { }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user