New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[6.2] Cannot read properties of undefined (reading 'logOutput') #424
Comments
@antongolub please take a look. |
@trin4ik, can you show how $ is loaded? It seems that rootCtx is empty, but we need to know why this happens. |
i dont know, what u mean "can u show how $ is loaded", i installed it like i wrote: trin@StayHome:~/develop/cargo/deploy$ zx ./test.mjs
$ pwd
file:///home/trin/.local/lib/node_modules/zx/build/print.js:35
let { logOutput = output, logFormat = () => msg, logPrint = printStd, logIgnore = [] } = ctx
^
TypeError: Cannot read properties of null (reading 'logOutput')
at log (file:///home/trin/.local/lib/node_modules/zx/build/print.js:35:8)
at Socket.onStdout (file:///home/trin/.local/lib/node_modules/zx/build/core.js:186:17)
... in print.js i see ...
export function log (opts, ...msg) {
let { scope, verbose = 1, output, raw } = opts
let ctx = getCtx()
> let { logOutput = output, logFormat = () => msg, logPrint = printStd, logIgnore = [] } = ctx
let level = Math.min(+getRootCtx().verbose, +ctx.verbose)
... in context.js: import { AsyncLocalStorage } from 'node:async_hooks';
let root;
const storage = new AsyncLocalStorage();
export function getCtx() {
return storage.getStore();
}
export function setRootCtx(ctx) {
storage.enterWith(ctx);
root = ctx;
}
export function getRootCtx() {
return root;
}
export const runInCtx = storage.run.bind(storage); if i change P.s. Собрались как-то трое русских на гитхабе и кааааак давай практиковать английский... |
* fix: bind fetch output to log() * fix: use root ctx as getCtx fallback closes #424 * refactor: simplify * refactor: rm deep-proxy * chore: revert shell tweak * chore: protect promise.ctx from accidental removal * test: test promise.ctx guard * fix: use root as fallback for `runInCtx`
Expected Behavior
working
Actual Behavior
not workink )
Steps to Reproduce the Problem
on 6.2.+ get error
on 6.1.- all ok
Specifications
The text was updated successfully, but these errors were encountered: