swdc-vscode icon indicating copy to clipboard operation
swdc-vscode copied to clipboard

Extension activation fails with error: RangeError: Maximum call stack size exceeded

Open morphx666 opened this issue 3 years ago • 9 comments

Describe the bug A clear and concise description of what the bug is.

After upgrading to VS Code 1.63.2 the extensions fails to load with the following error (from the ExtensionHost log):

[exthost] [error] Activating extension softwaredotcom.swdc-vscode failed due to an error:
[exthost] [error] RangeError: Maximum call stack size exceeded

Full Log Attached: error-log.txt

ISSUE TYPE

  • Bug Report

Desktop (please complete the following information):

  • OS: Windows 10
  • Plugin version: Code Time v2.6.19

morphx666 avatar Dec 20 '21 19:12 morphx666

Now running v2.6.21, but the problem persists. I have the exact same version of VS Code + the Code Time plugin on my laptop (running Ubuntu) and it works just fine.

morphx666 avatar Dec 26 '21 23:12 morphx666

We'll look into this right away, thank you for the update.

xavluiz avatar Dec 28 '21 21:12 xavluiz

Hi @morphx666, Is this still an issue with v2.6.22? Would you happen to have the output from the "CodeTime" channel as well? This will help in identifying what might be happening, thank you.

xavluiz avatar Dec 28 '21 21:12 xavluiz

I haven't tested it with v2.6.22 - I only see v2.6.21 available on VS Code's marketplace.

As for the output from CodeTime, is completely empty.

morphx666 avatar Dec 29 '21 02:12 morphx666

You're right. That version is currently in review. We'll look to get this available by next week. Thank you.

xavluiz avatar Dec 31 '21 21:12 xavluiz

Hi @morphx666,

v2.6.22 has been released. We've tested it on VSCode version 1.63.2 and haven't been able to reproduce the range error but let us know if it still a concern. Thank you.

xavluiz avatar Jan 04 '22 19:01 xavluiz

Unfortunately, it still doesn't work - but don't worry too much about it as it seems to be something related to this particular PC. It's working perfectly fine on three other computers.

I'll post back if I'm ever able to find a solution.

morphx666 avatar Jan 05 '22 00:01 morphx666

Ok, sounds good. Thank you for the update.

xavluiz avatar Jan 05 '22 18:01 xavluiz

Since today I had a couple of hours to spare I decide it to try to debug the compiled extension code.

I was able to find that the error occurs in this function:

t.getJsonItem = function (e, t) {
  const r = i ? i(e) : null;
  return r ? r[t] : null
}

I added some console.logs to have an idea of what was going on and it appears that, for some reason, the i function (which maps to getFileDataAsJson) was always null, even if I could see it declared just a couple of lines above.

So I added some code to log the other variables values whenever i was null.

Doing so, allowed the extension to load (instead of faulting because i(e) was null). And... for whatever reason, this fixed the problem! I got the dialog to login, I logged in using my account and the extension is now working again.

I have no idea what I did to fix it, but hopefully this might give you some insight on what may have gone wrong.

Thanks again for such a great extension!

morphx666 avatar Feb 09 '22 00:02 morphx666