bricks-cloud / vscode

The VS Code extension of Bricks, meant to be used with the main Bricks repository.
https://bricks-tech.com/
Apache License 2.0
0 stars 0 forks source link

Error: Webview is disposed #20

Closed donfour closed 1 year ago

donfour commented 1 year ago

Describe the bug VS Code webview is flaky. Sometimes closing and opening the live preview will lead to Error: Webview is disposed.

To Reproduce Steps to reproduce the behavior:

  1. In VS Code, click "activate bricks".
  2. Go to Figma, select any Figma component and generate code from it.
  3. Close webview by clicking on the "X".
  4. Go back to Figma, select any Figma component and generate code again.
  5. VS Code will crash sometimes, and show this error:
    [Extension Host] Error: Webview is disposed
    at s.c (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:102:36185)
    at s.get webview [as webview] (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:102:35156)
    at ZM (/Users/donovanso/.vscode/extensions/bricks.d2c-vscode-0.0.17/out/extension.js:977:213676)
    at Sw.<anonymous> (/Users/donovanso/.vscode/extensions/bricks.d2c-vscode-0.0.17/out/extension.js:1041:5315)

Expected behavior Webview should auto-open without error every time user generates code.

donfour commented 1 year ago

Fixed in https://github.com/bricks-cloud/vscode/commit/8b5e065c89da929c3f4d8c813fa95467d3aa9598