zx icon indicating copy to clipboard operation
zx copied to clipboard

Cannot access '$' before initialization

Open gajus opened this issue 2 years ago • 4 comments

Expected Behavior

No error.

Actual Behavior

ReferenceError: Cannot access '$' before initialization
    at AsyncHook.syncCwd (file:///D:/a/turbowatch/turbowatch/node_modules/zx/build/core.js:324:5)
    at emitHook (node:internal/async_hooks:235:38)
    at promiseResolveHook (node:internal/async_hooks:364:3)
    at file:///D:/a/turbowatch/turbowatch/node_modules/vitest/dist/vendor-rpc.4d3d7a54.js:54:7
    at withSafeTimers (file:///D:/a/turbowatch/turbowatch/node_modules/vitest/dist/vendor-rpc.4d3d7a54.js:21:20)
    at Proxy.safeSendCall (file:///D:/a/turbowatch/turbowatch/node_modules/vitest/dist/vendor-rpc.4d3d7a54.js:46:41)
    at process.exit (file:///D:/a/turbowatch/turbowatch/node_modules/vitest/dist/vendor-execute.132a3e09.js:321:11)
    at fatalError (node:internal/async_hooks:174:11)
    at emitHook (node:internal/async_hooks:239:5)
    at promiseResolveHook (node:internal/async_hooks:364:3)

Steps to Reproduce the Problem

https://github.com/gajus/turbowatch/actions/runs/5351190044/jobs/9704716871?pr=49

Specifications

  • Version: latest
  • Platform: Windows

Equivalent to earlier reported issue:

https://github.com/google/zx/issues/482

This happens only on Windows.

gajus avatar Jun 22 '23 23:06 gajus

Hi @gajus, I tried replicating this issue on my windows system, but I was unsuccessful. It would be great if you can explain more about how to replicate this error.

kavandalal avatar Jun 27 '23 07:06 kavandalal

Here is a link: https://github.com/gajus/turbowatch/pull/49

gajus avatar Jun 27 '23 14:06 gajus

Up from this morning, I have the same problem:

ReferenceError: Cannot access '$' before initialization
    at AsyncHook.syncCwd (file:///C:/Users/KopruchKlaus(Group)/Git-Repositories/materna/javascript_commons/packages/cli-tools/zx-wrapper/node_modules/zx/build/core.js:324:5)
    at emitHook (node:internal/async_hooks:235:38)
    at promiseResolveHook (node:internal/async_hooks:364:3)
    at ModuleJob.run (node:internal/modules/esm/module_job:192:25)
    at async DefaultModuleLoader.import (node:internal/modules/esm/loader:246:24)
    at async loadESM (node:internal/process/esm_loader:40:7)
    at async handleMainPromise (node:internal/modules/run_main:66:12)

Until this morning, I never had any problems using zx.

k7sleeper avatar Aug 04 '23 06:08 k7sleeper

This morning I turned on my PC in the office. Everything was ok with zx.

After upgrade from v7.2.2 to v7.2.3 I also have this issue on my office PC.

k7sleeper avatar Aug 08 '23 14:08 k7sleeper