MCPcopy Create free account
hub / github.com/arktypeio/arktype / writeStoppedMessage

Function writeStoppedMessage

ark/aot/worker.ts:46–52  ·  view source on GitHub ↗
(
	stopped: string,
	fails: "throws" | "exits"
)

Source from the content-addressed store, hash-verified

44 ].map(match => match[1])
45
46export const writeStoppedMessage = (
47 stopped: string,
48 fails: "throws" | "exits"
49): string => {
50 const preloads = nodeOptionPreloads()
51 return `@ark/aot's precompiler ${stopped} before it answered, as it does where a module the process preloads ${fails} in a worker thread${preloads.length ? `, like ${preloads.join(" or ")}, which NODE_OPTIONS loads` : ""}. Pass it to node as a flag instead, as \`node --import ${preloads[0] ?? "./setup.ts"}\`, which keeps it out of the precompiler's thread, or return from it early where \`isMainThread\` from node:worker_threads is false. To see its error and stack, run \`node -e 'new (require("node:worker_threads").Worker)(new URL("data:text/javascript,"))'\` with the same NODE_OPTIONS.`
52}
53
54const waiting = 0
55const answered = 1

Callers 2

createSyncPrecompilerFunction · 0.85
createAsyncPrecompilerFunction · 0.85

Calls 1

nodeOptionPreloadsFunction · 0.85

Tested by

no test coverage detected