certinia / debug-log-analyzer

Salesforce Apex debug log analyzer for Visual Studio Code - Visualize code execution via a Flame chart and identify performance and SOQL/DML problems via Method and Database analysis
https://marketplace.visualstudio.com/items?itemName=financialforce.lana
BSD 3-Clause "New" or "Revised" License
82 stars 18 forks source link

bug: Failed to register a ServiceWorker: The document is in an invalid state.. #534

Closed neocolmartin closed 3 weeks ago

neocolmartin commented 4 weeks ago

Summary

After the July 2024 update, when trying to open Log Analyzer I get this error:

Error loading webview: Error: Could not register service worker: InvalidStateError: Failed to register a ServiceWorker: The document is in an invalid state..

Steps To Reproduce

  1. Open a log file
  2. Either select "Log: Show Apex Log Analysis" from the commands menu or right-click on the editor tab & select the same.

Expected result

The log analysis should open.

Actual result

I get this error:

Error loading webview: Error: Could not register service worker: InvalidStateError: Failed to register a ServiceWorker: The document is in an invalid state..

Additional information

image

In addition, looking in the "ExtensionHost" log I see the following, but I do not know if it is related:

2024-08-15 14:15:59.400 [info] ExtensionService#_doActivateExtension FinancialForce.lana, startup: false, activationEvent: 'onLanguage:apexlog'
2024-08-15 14:17:27.713 [info] Extension host terminating: renderer closed the MessagePort
2024-08-15 14:17:27.816 [error] Canceled: Canceled
    at new C (c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:144:35204)
    at E.U (c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:151:6017)
    at B.<computed>.j.charCodeAt.R.CharCode.DollarSign.B.<computed> (c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:151:3107)
    at d.g (c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:154:205942)
    at d.executeCommand (c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:154:205380)
    at A.registerCommand.description (c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:154:204704)
    at d.h (c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:154:206481)
    at d.g (c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:154:205473)
    at d.executeCommand (c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:154:205380)
    at Object.executeCommand (c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:164:23060)
    at i.O [as value] (c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\git\dist\main.js:2:951642)
    at n.B (c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:83:737)
    at n.C (c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:83:807)
    at n.fire (c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:83:1023)
    at Object.p [as dispose] (c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\git\dist\main.js:2:972220)
    at c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\git\dist\main.js:2:978342
    at Array.forEach (<anonymous>)
    at f.dispose (c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\git\dist\main.js:2:978328)
    at a.<anonymous> (c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:152:4173)
    at a.dispose (c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:152:4270)
    at a.<anonymous> (c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\git\dist\main.js:2:953940)
    at a.dispose (c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:152:4270)
    at $ (c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:30:744)
    at c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:160:13379
    at c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:30:1112
    at Object.dispose (c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:11:11354)
    at m.eb (c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:160:10056)
    at c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:160:7927
    at Array.map (<anonymous>)
    at m.$ (c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:160:7914)
    at m.terminate (c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:160:8187)
    at $.terminate (c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:164:1513)
    at o (c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:177:10633)
    at MessagePortMain.<anonymous> (c:\Users\Martin Pain\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:177:6825)
    at MessagePortMain.emit (node:events:519:28)
    at MessagePortMain._internalPort.emit (node:electron/js2c/utility_init:2:2285) setContext undefined

(A similar stack trace is logged 2 more times)

VS Code Version: 1.92.1

Log Analyzer Extension Version: 1.16.0

OS and version: Windows 11 Pro 23H2

lcottercertinia commented 4 weeks ago

@neocolmartin I think you have come across this vscode issue microsoft/vscode#125993 It is an issue with vscode and webviews, there is quite a bit of advice on the issue.

First try restarting vscode/ your machine and see if that helps.

neocolmartin commented 3 weeks ago

Thanks, that helped!

lcottercertinia commented 3 weeks ago

@neocolmartin Glad you are sorted!