This means i am conditionally using the pino-pretty transport only in development and I am using pino@8.7.0
This throw the following exception
importing the script /home/raynos/soundxyz/code/tools/admin-tools/src/scripts/reloadArweave.ts
bigint: Failed to load bindings, pure JS will be used (try npm run rebuild?)
node:internal/event_target:1083
process.nextTick(() => { throw err; });
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/raynos/soundxyz/code/tools/shared/bob-tsm-hooks.cjs' imported from /home/raynos/soundxyz/code/tools/admin-tools/src/
at new NodeError (node:internal/errors:406:5)
at finalizeResolution (node:internal/modules/esm/resolve:233:11)
at moduleResolve (node:internal/modules/esm/resolve:845:10)
at defaultResolve (node:internal/modules/esm/resolve:1043:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:383:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:352:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:228:38)
at ModuleLoader.import (node:internal/modules/esm/loader:315:34)
at node:internal/process/esm_loader:26:84
at node:internal/per_context/primordials:544:39
Emitted 'error' event on Worker instance at:
at [kOnErrorMessage] (node:internal/worker:326:10)
at [kOnMessage] (node:internal/worker:337:37)
at MessagePort.<anonymous> (node:internal/worker:232:57)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:807:20)
at exports.emitMessage (node:internal/per_context/messageport:23:28) {
url: 'file:///home/raynos/soundxyz/code/tools/shared/bob-tsm-hooks.cjs',
code: 'ERR_MODULE_NOT_FOUND'
}
Node.js v20.9.0
ELIFECYCLE Command failed with exit code 1.
I have code like the following
This means i am conditionally using the
pino-pretty
transport only in development and I am usingpino@8.7.0
This throw the following exception
I run my entire program with
The combination of a transport, a worker thread and the
--import
flag makes the worker thread itself throw an exception.It's also because my code actually calls
I imagine this
process.chdir()
also makes a mess of things.I spend half an hour debugging it before i disabled the
pino-pretty
transport and identified this was the source of the uncaught.