microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.13k stars 28.52k forks source link

Error: `chatParticipant must be declared in package.json` even though it is already specified #222011

Closed JeromeJu closed 1 month ago

JeromeJu commented 1 month ago

Does this issue occur when all extensions are disabled?: Yes

Steps to Reproduce:

  1. Create a new extension with chat participant (following chat-example).
  2. Run with debug target in the Debug view.
  3. In the new window opened there is no new extension in the activity bar.
  4. When a chatParticipant is triggered through the command palette, it shows the current error:
    2024-07-17 11:09:53.049 [error] Error: chatParticipant must be declared in package.json: ongea.github
    at S.$registerAgent (vscode-file://vscode-app/private/var/folders/6w/78wy05qx2y3cwd5v96bmdt0000zp1h/T/AppTranslocation/DB77D7CD-89D5-4337-A204-300F2AA4697F/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2413:130105)
    at S (vscode-file://vscode-app/private/var/folders/6w/78wy05qx2y3cwd5v96bmdt0000zp1h/T/AppTranslocation/DB77D7CD-89D5-4337-A204-300F2AA4697F/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1678:14630)
    at S.Q (vscode-file://vscode-app/private/var/folders/6w/78wy05qx2y3cwd5v96bmdt0000zp1h/T/AppTranslocation/DB77D7CD-89D5-4337-A204-300F2AA4697F/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1678:14396)
    at S.M (vscode-file://vscode-app/private/var/folders/6w/78wy05qx2y3cwd5v96bmdt0000zp1h/T/AppTranslocation/DB77D7CD-89D5-4337-A204-300F2AA4697F/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1678:13429)
    at S.L (vscode-file://vscode-app/private/var/folders/6w/78wy05qx2y3cwd5v96bmdt0000zp1h/T/AppTranslocation/DB77D7CD-89D5-4337-A204-300F2AA4697F/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1678:12485)
    at d.value (vscode-file://vscode-app/private/var/folders/6w/78wy05qx2y3cwd5v96bmdt0000zp1h/T/AppTranslocation/DB77D7CD-89D5-4337-A204-300F2AA4697F/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1678:10959)
    at l.B (vscode-file://vscode-app/private/var/folders/6w/78wy05qx2y3cwd5v96bmdt0000zp1h/T/AppTranslocation/DB77D7CD-89D5-4337-A204-300F2AA4697F/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:93:732)
    at l.fire (vscode-file://vscode-app/private/var/folders/6w/78wy05qx2y3cwd5v96bmdt0000zp1h/T/AppTranslocation/DB77D7CD-89D5-4337-A204-300F2AA4697F/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:93:949)
    at s.fire (vscode-file://vscode-app/private/var/folders/6w/78wy05qx2y3cwd5v96bmdt0000zp1h/T/AppTranslocation/DB77D7CD-89D5-4337-A204-300F2AA4697F/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:620:14823)
    at x.onmessage (vscode-file://vscode-app/private/var/folders/6w/78wy05qx2y3cwd5v96bmdt0000zp1h/T/AppTranslocation/DB77D7CD-89D5-4337-A204-300F2AA4697F/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1693:8186)
gjsjohnmurray commented 1 month ago

I suggest you fork vscode-extension-samples to a public repo in your git account create a branch (perhaps named show-222202) and push any changes you made in chat-example. Doing this should make it easier to repro, or at least to verify that things work OK on the mainstream platforms.

gjsjohnmurray commented 1 month ago

Original thread at https://github.com/microsoft/vscode-discussions/discussions/1273

JeromeJu commented 1 month ago

Thanks @gjsjohnmurray I've created the fork with the changes I've made at fork. I've been trying to aim for the simplest for debugging. Changes I've made:

And I'm seeing the following error:

024-07-18 11:37:13.462 [error] Error: chatParticipant must be declared in package.json: chat-sample.cat
    at S.$registerAgent (vscode-file://vscode-app/private/var/folders/6w/78wy05qx2y3cwd5v96bmdt0000zp1h/T/AppTranslocation/D76BDC9E-61AA-4F5C-A947-BA47D400B1A1/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2413:130105)
    at S (vscode-file://vscode-app/private/var/folders/6w/78wy05qx2y3cwd5v96bmdt0000zp1h/T/AppTranslocation/D76BDC9E-61AA-4F5C-A947-BA47D400B1A1/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1678:14630)
    at S.Q (vscode-file://vscode-app/private/var/folders/6w/78wy05qx2y3cwd5v96bmdt0000zp1h/T/AppTranslocation/D76BDC9E-61AA-4F5C-A947-BA47D400B1A1/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1678:14396)
    at S.M (vscode-file://vscode-app/private/var/folders/6w/78wy05qx2y3cwd5v96bmdt0000zp1h/T/AppTranslocation/D76BDC9E-61AA-4F5C-A947-BA47D400B1A1/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1678:13429)
    at S.L (vscode-file://vscode-app/private/var/folders/6w/78wy05qx2y3cwd5v96bmdt0000zp1h/T/AppTranslocation/D76BDC9E-61AA-4F5C-A947-BA47D400B1A1/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1678:12485)
    at d.value (vscode-file://vscode-app/private/var/folders/6w/78wy05qx2y3cwd5v96bmdt0000zp1h/T/AppTranslocation/D76BDC9E-61AA-4F5C-A947-BA47D400B1A1/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1678:10959)
    at l.B (vscode-file://vscode-app/private/var/folders/6w/78wy05qx2y3cwd5v96bmdt0000zp1h/T/AppTranslocation/D76BDC9E-61AA-4F5C-A947-BA47D400B1A1/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:93:732)
    at l.fire (vscode-file://vscode-app/private/var/folders/6w/78wy05qx2y3cwd5v96bmdt0000zp1h/T/AppTranslocation/D76BDC9E-61AA-4F5C-A947-BA47D400B1A1/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:93:949)
    at s.fire (vscode-file://vscode-app/private/var/folders/6w/78wy05qx2y3cwd5v96bmdt0000zp1h/T/AppTranslocation/D76BDC9E-61AA-4F5C-A947-BA47D400B1A1/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:620:14823)
    at x.onmessage (vscode-file://vscode-app/private/var/folders/6w/78wy05qx2y3cwd5v96bmdt0000zp1h/T/AppTranslocation/D76BDC9E-61AA-4F5C-A947-BA47D400B1A1/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1693:8186)
roblourens commented 1 month ago

Your repo is working fine for me. I just had to delete a comma in the package.json to run 'npm install'.

Image

If you still see an issue, I wonder whether the activationEvent could be an issue, can you try removing that to test?

JeromeJu commented 1 month ago

Your repo is working fine for me. I just had to delete a comma in the package.json to run 'npm install'.

Image

If you still see an issue, I wonder whether the activationEvent could be an issue, can you try removing that to test?

Hi @roblourens , thanks for looking into this - after removing the activationEvent I don't see anything extension icon popping out and there's nothing in the Extension logs console; neither anything new in the running extension view.

Would you mind pointing me at anything that I could look into that's wrong?

roblourens commented 1 month ago

I don't understand what you're looking for- does your participant show up in the chat input or not?

JeromeJu commented 1 month ago

I don't understand what you're looking for- does your participant show up in the chat input or not?

My issue is that I don't see the extension popping up when it's being run - may I check with you if that's the prerequisite step; so I don't have the ability to verify the registration of chat participants either.

Hope that clarifies my case - please lemme know if there're anything needed.

roblourens commented 1 month ago

You should expect to see your chat participant available in the github copilot chat window. I don't know what "popup" you're looking for

JeromeJu commented 1 month ago

You should expect to see your chat participant available in the github copilot chat window. I don't know what "popup" you're looking for

Thanks for this @roblourens I figured I've disabled Copilot a while ago and now opting it in it worked for me. But there's other error I've seen:

[error] Error: Tool "copilot_codebase" was not contributed.
    at y.registerToolImplementation (vscode-file://vscode-app/private/var/folders/6w/78wy05qx2y3cwd5v96bmdt0000zp1h/T/AppTranslocation/D76BDC9E-61AA-4F5C-A947-BA47D400B1A1/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1479:2560)
    at L.$registerTool (vscode-file://vscode-app/private/var/folders/6w/78wy05qx2y3cwd5v96bmdt0000zp1h/T/AppTranslocation/D76BDC9E-61AA-4F5C-A947-BA47D400B1A1/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1671:1200)
    at S (vscode-file://vscode-app/private/var/folders/6w/78wy05qx2y3cwd5v96bmdt0000zp1h/T/AppTranslocation/D76BDC9E-61AA-4F5C-A947-BA47D400B1A1/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1678:14630)
    at S.Q (vscode-file://vscode-app/private/var/folders/6w/78wy05qx2y3cwd5v96bmdt0000zp1h/T/AppTranslocation/D76BDC9E-61AA-4F5C-A947-BA47D400B1A1/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1678:14396)
    at S.M (vscode-file://vscode-app/private/var/folders/6w/78wy05qx2y3cwd5v96bmdt0000zp1h/T/AppTranslocation/D76BDC9E-61AA-4F5C-A947-BA47D400B1A1/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1678:13429)
    at S.L (vscode-file://vscode-app/private/var/folders/6w/78wy05qx2y3cwd5v96bmdt0000zp1h/T/AppTranslocation/D76BDC9E-61AA-4F5C-A947-BA47D400B1A1/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1678:12264)
    at d.value (vscode-file://vscode-app/private/var/folders/6w/78wy05qx2y3cwd5v96bmdt0000zp1h/T/AppTranslocation/D76BDC9E-61AA-4F5C-A947-BA47D400B1A1/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1678:10959)
    at l.B (vscode-file://vscode-app/private/var/folders/6w/78wy05qx2y3cwd5v96bmdt0000zp1h/T/AppTranslocation/D76BDC9E-61AA-4F5C-A947-BA47D400B1A1/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:93:732)
    at l.fire (vscode-file://vscode-app/private/var/folders/6w/78wy05qx2y3cwd5v96bmdt0000zp1h/T/AppTranslocation/D76BDC9E-61AA-4F5C-A947-BA47D400B1A1/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:93:949)
    at s.fire (vscode-file://vscode-app/private/var/folders/6w/78wy05qx2y3cwd5v96bmdt0000zp1h/T/AppTranslocation/D76BDC9E-61AA-4F5C-A947-BA47D400B1A1/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:620:14823)
    at x.onmessage (vscode-file://vscode-app/private/var/folders/6w/78wy05qx2y3cwd5v96bmdt0000zp1h/T/AppTranslocation/D76BDC9E-61AA-4F5C-A947-BA47D400B1A1/d/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1693:8186)
JeromeJu commented 1 month ago

Also a list of: Error: Tool "copilot_selection" was not contributed. Error: Tool "copilot_editor" was not contributed. Error: Tool "copilot_terminalSelection" was not contributed.

roblourens commented 1 month ago

Glad it's working now. Not sure why you're getting those errors but you can ignore them.