google / clasp

🔗 Command Line Apps Script Projects
https://developers.google.com/apps-script/guides/clasp
Apache License 2.0
4.59k stars 428 forks source link

Error running clasp commands #871

Open lucas-labs opened 3 years ago

lucas-labs commented 3 years ago

Expected Behavior

No error.

Actual Behavior

Trying to run any command on a freshly installed clasp on Windows 10 / node 16.3.0 throws the following error:

c:\ws\src\api\callback.cc:129: Assertion `(env_->execution_async_id()) == (0)' failed.

The error happens with every command, except for clasp --version

The file referenced in the error message doesn't actually exist on my system (c:\ws\src\api\callback.cc:129). Which I find weird, since it says it's failing on the line number 129 of a file that doesn't exist.

Steps to Reproduce the Problem

~:
$ node --version
v16.3.0

~:
$ npm install -g @google/clasp

added 237 packages, and audited 238 packages in 1m

58 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

~:
$ which clasp

CommandType     Name       Version    Source
-----------     ----       -------    ------
ExternalScript  clasp.ps1             C:\Users\consumix\AppData\Roaming\npm\clasp.ps1

$ clasp -v
2.4.1

~:
$ clasp login
Logging in globally…
Administrator: Windows PowerShell[17088]: c:\ws\src\api\callback.cc:129: Assertion `(env_->execution_async_id()) == (0)' failed.
 1: 00007FF76BFEB05F v8::internal::CodeObjectRegistry::~CodeObjectRegistry+111311
 2: 00007FF76BF7CEA6 v8::internal::MicrotaskQueue::GetMicrotasksScopeDepth+65014
 3: 00007FF76BF7D221 v8::internal::MicrotaskQueue::GetMicrotasksScopeDepth+65905
 4: 00007FF76C01A5BD node::CallbackScope::~CallbackScope+1021
 5: 00007FF76C01A22E node::CallbackScope::~CallbackScope+110
 6: 00007FF76BF66920 v8::base::CPU::has_sse+33120
 7: 00007FF76C04E837 uv_timer_stop+775
 8: 00007FF76C04B02B uv_async_send+331
 9: 00007FF76C04A7BC uv_loop_init+1292
10: 00007FF76C04A95A uv_run+202
11: 00007FF76C019C24 node::SpinEventLoop+308
12: 00007FF76BF35973 v8::internal::AsmJsScanner::GetIdentifierString+53635
13: 00007FF76BFB09D7 node::Start+215
14: 00007FF76BDD84FC RC4_options+347132
15: 00007FF76CEA067C v8::internal::compiler::RepresentationChanger::Uint32OverflowOperatorFor+151692
16: 00007FF880247034 BaseThreadInitThunk+20
17: 00007FF881182651 RtlUserThreadStart+33

Specifications

lucas-labs commented 3 years ago

Update

It fails with the same error message with version 2.4.0, but it works ok downgrading to v2.3.2

~:
$ clasp -v
2.3.2

~:
$ clasp login  
Logging in globally...
🔑 Authorize clasp by visiting this url:
...
Authorization successful.

Default credentials saved to: ~\.clasprc.json ...
PopGoesTheWza commented 3 years ago

It could well be that an async or promise is not properly handled. #873 addresses a couple of such case.

lucas-labs commented 3 years ago

Thanks @PopGoesTheWza ! By the way, I'm having this issue on Windows 10, but I recently tried to run clasp 2.4.0 on Ubuntu 20.04, and got the same error message. I had to downgrade it to 2.3.2 to make it work.