Compare commits

...
5 changed files with 34 additions and 15 deletions

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
"@jackyzha0/quartz": patch
---
When a build stops on an error, Quartz stops esbuild before exiting. esbuild runs as a child process that writes to the same terminal; left running, it could print "fatal error: all goroutines are asleep - deadlock!" and a long goroutine dump after Quartz's error message.
+13 -13
View File
@@ -37,7 +37,7 @@
"@quartz-community/graph": "^1.0.0",
"@quartz-community/hard-line-breaks": "^1.0.0",
"@quartz-community/latex": "^1.0.0",
"@quartz-community/note-properties": "^1.0.0",
"@quartz-community/note-properties": "^1.1.1",
"@quartz-community/obsidian-flavored-markdown": "^2.0.0",
"@quartz-community/og-image": "^1.0.0",
"@quartz-community/ox-hugo": "^1.0.0",
@@ -2892,9 +2892,9 @@
}
},
"node_modules/@quartz-community/note-properties": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@quartz-community/note-properties/-/note-properties-1.1.0.tgz",
"integrity": "sha512-TYpEDTO9Im3zZBqKpsQHFbSABj/FPswPSBBhle9FSiNUQpIOSZk6lj6Yw3LHz2mpa01w3Cvag5MGtugYe+HYEQ==",
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@quartz-community/note-properties/-/note-properties-1.1.1.tgz",
"integrity": "sha512-kURVT2PTQZTcRZxiT7o/gerI/8n0EhVogLaMznviJXYKSSvenE+8uKlPxJtZr1nbTJOn73UNBr5iNMhQIycQtg==",
"license": "MIT",
"dependencies": {
"@quartz-community/types": "^1.0.0",
@@ -2918,9 +2918,9 @@
}
},
"node_modules/@quartz-community/obsidian-flavored-markdown": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@quartz-community/obsidian-flavored-markdown/-/obsidian-flavored-markdown-2.0.0.tgz",
"integrity": "sha512-B8Q52yWmtvuNXpmRuNRHZSTgjAcdzT2N0eQiZhYfykUC6dQwMNs/mHIzxBK8T7A8xr3KjkGrtqzEM1s49dYjgw==",
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@quartz-community/obsidian-flavored-markdown/-/obsidian-flavored-markdown-2.1.0.tgz",
"integrity": "sha512-yOLBsYrJ5IVjxhl/ppZmXQAHianKkeIGMvDT7mwNOaalsah19p9luHrPYg0eEsn1o6IkHFP8h1LaY2WT+wIABw==",
"license": "MIT",
"dependencies": {
"@quartz-community/rehype-obsidian": "^1.2.0",
@@ -3296,9 +3296,9 @@
}
},
"node_modules/@quartz-community/types": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@quartz-community/types/-/types-1.1.0.tgz",
"integrity": "sha512-FedvwWskypTuEd/ZNqV7o/HjSE+F9rQGpBxy35Ia/hUitUA92tJsoxOtX+OAOjsB0kEq679e60zCXoyoIq8QRA==",
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/@quartz-community/types/-/types-1.2.0.tgz",
"integrity": "sha512-82L+hallWn9LCMw9kFUWJhAGwlTd4rT2KxxL8B7IAWTEvj/20StWsuC01Mbfk5hLhd8jAHGgj1WHb0u/cdUXEA==",
"license": "MIT",
"dependencies": {
"unified": "^11.0.5",
@@ -7604,9 +7604,9 @@
"license": "ISC"
},
"node_modules/ws": {
"version": "8.22.1",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.22.1.tgz",
"integrity": "sha512-oyL6OPYme/CmiFvNuGzeoxCJ4nOrZE2O1FwM9MWM1AsGri6nLXB2pg+lNA8aLeXMSav0J6eIVS1j6vUPzUtK9g==",
"version": "8.22.2",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.22.2.tgz",
"integrity": "sha512-/rEZ2ejown2N5gxVTHUu9bVVC7ttu0/Tgzf5hbTOixR3Fs7mbbXgn2DbdbcKgJOmpQMtrIUWivtYuVMnp/W/yA==",
"license": "MIT",
"engines": {
"node": ">=10.0.0"
+1 -1
View File
@@ -67,7 +67,7 @@
"@quartz-community/graph": "^1.0.0",
"@quartz-community/hard-line-breaks": "^1.0.0",
"@quartz-community/latex": "^1.0.0",
"@quartz-community/note-properties": "^1.0.0",
"@quartz-community/note-properties": "^1.1.1",
"@quartz-community/obsidian-flavored-markdown": "^2.0.0",
"@quartz-community/og-image": "^1.0.0",
"@quartz-community/ox-hugo": "^1.0.0",
+2
View File
@@ -428,6 +428,8 @@ export async function handleBuild(argv) {
`${styleText("red", "Failed to build Quartz.")} Check for syntax errors in your configuration or plugins.`,
)
console.log(`Reason: ${styleText("gray", err.message ?? String(err))}`)
// stop esbuild's child process first: it shares our stderr and outlives us otherwise
void esbuild.stop()
process.exit(1)
})
release()
+13 -1
View File
@@ -1,5 +1,6 @@
import { styleText } from "util"
import process from "process"
import esbuild from "esbuild"
import { isMainThread } from "workerpool"
import { isContentError, pluginErrorInfo, PluginErrorInfo } from "./pluginErrors"
import { knownProblemsFor } from "./diagnostics"
@@ -130,6 +131,17 @@ export function trace(msg: string, err: Error) {
} else {
// print and exit
console.error(traceMsg)
process.exit(1)
exitBuild(1)
}
}
/**
* Exit the build process. esbuild's service is a child process that shares our stderr; exiting
* while it has requests in flight (bundling component scripts, the CLI's build context) left it
* running without its parent, and it printed "fatal error: all goroutines are asleep - deadlock!"
* and a goroutine dump after Quartz's error. Stop it first.
*/
export function exitBuild(code: number): never {
void esbuild.stop()
process.exit(code)
}