meltylabs / melty

Chat first code editor. To download the packaged app:
https://docs.google.com/forms/d/e/1FAIpQLSc6uBe0ea26q7Iq0Co_q5fjW2nypUl8G_Is5M_6t8n7wZHuPA/viewform
MIT License
4.75k stars 307 forks source link

Melty screen black after first task. #85

Open iamlasse opened 1 week ago

iamlasse commented 1 week ago

After running melty ai once, the extension overlay goes blank and just shows a black screen. I've attached some screenshots of the issue.

The console running melty:code also shows some warnings and notices

pi/browser/mainThreadExtensionService.js (55)
[57253:0921/130303.571144:INFO:CONSOLE(56)] "SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at /Users/lasselarsen/.meltycode-dev/extensions/mohamedbenhida.laravel-intellisense-0.2.0-universal/src/ViewItemProvider.ts:58:25", source: vscode-file://vscode-app/Users/lasselarsen/Developer/melty/out/vs/workbench/api/browser/mainThreadExtensionService.js (56)
[57253:0921/130303.940735:INFO:CONSOLE(104)] "%c[Extension Host] %c[Codeium Chat] no webview to send message to. %c(at console.<anonymous> (/Users/lasselarsen/Developer/melty/out/vs/workbench/api/common/file:/Users/lasselarsen/Developer/melty/src/vs/workbench/api/common/extHostConsoleForwarder.ts:50:10)) color: blue color:  color: grey", source: vscode-file://vscode-app/Users/lasselarsen/Developer/melty/out/vs/base/common/console.js (104)
[57253:0921/130306.945685:INFO:CONSOLE(104)] "%c[Extension Host] %c[Codeium Chat] no webview to send message to. %c(at console.<anonymous> (/Users/lasselarsen/Developer/melty/out/vs/workbench/api/common/file:/Users/lasselarsen/Developer/melty/src/vs/workbench/api/common/extHostConsoleForwarder.ts:50:10)) color: blue color:  color: grey", source: vscode-file://vscode-app/Users/lasselarsen/Developer/melty/out/vs/base/common/console.js (104)
[57253:0921/130308.575467:INFO:CONSOLE(104)] "%c[Extension Host] %crejected promise not handled within 1 second: SyntaxError: Unexpected end of JSON input %c(at console.<anonymous> (/Users/lasselarsen/Developer/melty/out/vs/workbench/api/common/file:/Users/lasselarsen/Developer/melty/src/vs/workbench/api/common/extHostConsoleForwarder.ts:50:10)) color: blue color:  color: grey", source: vscode-file://vscode-app/Users/lasselarsen/Developer/melty/out/vs/base/common/console.js (104)
[57253:0921/130308.576120:INFO:CONSOLE(104)] "%c[Extension Host] %cstack trace: SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at /Users/lasselarsen/.meltycode-dev/extensions/mohamedbenhida.laravel-intellisense-0.2.0-universal/src/ViewItemProvider.ts:58:25 %c(at console.<anonymous> (/Users/lasselarsen/Developer/melty/out/vs/workbench/api/common/file:/Users/lasselarsen/Developer/melty/src/vs/workbench/api/common/extHostConsoleForwarder.ts:50:10)) color: blue color:  color: grey", source: vscode-file://vscode-app/Users/lasselarsen/Developer/melty/out/vs/base/common/console.js (104)
[57253:0921/130308.576267:INFO:CONSOLE(55)] "[mohamedbenhida.laravel-intellisense]Unexpected end of JSON input", source: vscode-file://vscode-app/Users/lasselarsen/Developer/melty/out/vs/workbench/api/browser/mainThreadExtensionService.js (55)
[57253:0921/130308.576332:INFO:CONSOLE(56)]
Screenshot 2024-09-21 at 13 01 03 Screenshot 2024-09-21 at 13 02 07 Screenshot 2024-09-21 at 13 02 24
erson commented 1 week ago

remove node_modules and pull the latest version. reinstall with yarn. try again with ./scripts/code.sh
I think your issue is going to be resolved.

iamlasse commented 1 week ago

I've pulled down the latest (I was already on the latest main) and deleted node_modules. The problem still persists. Each task ends in a blank black screen and I have to quit to get the melty ai screen back

abhi12299 commented 1 week ago

what's the error on the devtools?

iamlasse commented 1 week ago

I will check, i hadn't thought of the devtools.

jacksondc commented 1 week ago

Hey, I believe there's a memory leak introduced in the latest version. Need to look into this.

iamlasse commented 1 week ago

main.js:40 TypeError: Cannot read properties of undefined (reading 'map') at wse (main.js:393:9810) at Yy (main.js:38:16998) at HE (main.js:40:3139) at LL (main.js:40:44804) at OL (main.js:40:39766) at Q$ (main.js:40:39694) at Ec (main.js:40:39547) at ev (main.js:40:35914) at AL (main.js:40:34865) at _ (main.js:25:1539)

main.js:393 Uncaught TypeError: Cannot read properties of undefined (reading 'map') at wse (main.js:393:9810) at Yy (main.js:38:16998) at HE (main.js:40:3139) at LL (main.js:40:44804) at OL (main.js:40:39766) at Q$ (main.js:40:39694) at Ec (main.js:40:39547) at ev (main.js:40:35914) at AL (main.js:40:34865) at _ (main.js:25:1539)

ERR [uncaught exception in main]: net::ERR_CONNECTION_REFUSED: Error: net::ERR_CONNECTION_REFUSED at SimpleURLLoaderWrapper. (node:electron/js2c/browser_init:2:114482) at SimpleURLLoaderWrapper.emit (node:events:519:28)

These are some errors that show up when the screen goes black.

rrfaria commented 1 week ago

Same issue here after some interactions.

I just asked Melty to rewrite my app using React. After thinking a little and writing some code, it broke.

image
rrfaria commented 6 days ago

I solved this issue by adding optional chain on each map in. Just search on folder for .map

extensions/spectacular/src/backend/

image

But another issue appeared, if I have more time I'll help investigate:

image

another error that always happen and I yet don't found solution:

mainThreadExtensionService.ts:79 Error: No such branch: master.
    at Repository.getBranch (vscode-file://melty/extensions/git/out/git.js:2077:31)
    at async Repository.retryRun (vscode-file://melty/extensions/git/out/repository.js:1667:24)
    at async Repository.run (vscode-file://melty/extensions/git/out/repository.js:1641:28)
    at async Repository.getBranch (vscode-file://melty/extensions/git/out/repository.js:1122:16)
    at async Repository.getBranchBase (vscode-file://melty/extensions/git/out/repository.js:1131:24)
    at async GitHistoryProvider.resolveHEADMergeBase (vscode-file://melty/extensions/git/out/historyProvider.js:283:27)
    at async GitHistoryProvider.onDidRunGitStatus (vscode-file://melty/extensions/git/out/historyProvider.js:43:27)

I some case this error happen but is sporadically:

  ERR [uncaught exception in main]: net::ERR_CONNECTION_REFUSED: Error: net::ERR_CONNECTION_REFUSED
    at SimpleURLLoaderWrapper.<anonymous> (node:electron/js2c/browser_init:2:114482)
    at SimpleURLLoaderWrapper.emit (node:events:519:28)
jacksondc commented 6 days ago

I think the .map issue was introduced by a change I made a few days ago; if so, this should fix it.

I'll try to take a look at the other issues soon.

iamlasse commented 6 days ago

I've pulled down the latest version of main, reinstalled yarn deps and recorded a video for you to see the issue still happens

https://share.vidyard.com/watch/bn879qwyBb9RaL3Sq3ficx?

rrfaria commented 6 days ago

@iamlasse @jacksondc

For me, to works, I did these steps:

Note:

Sometimes, the AI didn't follow instructions to <change_code> and broke because it didn't save the file. To address this, I made some tweaks on prompt and force model to remember system prompt instructions.

image

then ai fixed this issue.

Another issue is with git commit, when model tries to commit code it brokes, to avoid it, I asked to model to postpone the commit until I finish implementation. It didn't solve the problem but I could finish the code generation using melty.

iamlasse commented 1 day ago

I have changed to optional .map in 2 places and that seemed to work for this issue. I can make a pr if you want, or just tell you where I made the changes here.

Screenshot 2024-09-30 at 09 42 15 Screenshot 2024-09-30 at 09 42 37

Very simple changes really.