Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TeamsApp CLI Bug Declarative Agent - Template Not Found #13003

Closed
pkbullock opened this issue Jan 2, 2025 · 4 comments
Closed

TeamsApp CLI Bug Declarative Agent - Template Not Found #13003

pkbullock opened this issue Jan 2, 2025 · 4 comments
Assignees
Labels
investigating needs attention This issue needs the attention of a contributor. TA:E2E Team Area: E2E

Comments

@pkbullock
Copy link

Describe the bug
Cannot generate Teams App with Teams App CLI

To Reproduce
Install TeamsApp CLI: npm install-g @microsoft/teamsapp-cli

Run:

teamsapp new --capability "declarative-agent" --app-name "Hello World Declarative Agent" -programming-language "typescript" -folder "HelloWorldTS9" --interactive false --debug --verbose --with-plugin no 

Expected behavior
Generates the Declarative Agent.

CLI Information (please complete the following information):

  • Windows
  • CLI Version 3.0.6

Additional context
I found a reference in

that might be the point in which this isn't aligning to the templates.

Error details:

teamsapp new --capability "declarative-agent" --app-name "HelloWorldDeclarativeAgent" -programming-language "typescript" -folder "HelloWorldTS10" --interactive false --debug --verbose --with-plugin no
user argument list: ["new","--capability","declarative-agent","--app-name","HelloWorldDeclarativeAgent","-programming-language","typescript","-folder","HelloWorldTS10","--interactive","false","--debug","--verbose","--with-plugin","no"]
matched command: teamsapp new
find option: {"token":"--capability","option":"capability","value":"declarative-agent","isGlobal":false}
find option: {"token":"--app-name","option":"app-name","value":"HelloWorldDeclarativeAgent","isGlobal":false}
find option: {"token":"-programming-language","option":"programming-language","value":"typescript","isGlobal":false}
find option: {"token":"-folder","option":"folder","value":"HelloWorldTS10","isGlobal":false}
find option: {"token":"--interactive","option":"interactive","value":false,"isGlobal":true}
find option: {"token":"--debug","option":"debug","value":true,"isGlobal":true}
find option: {"token":"--verbose","option":"verbose","value":true,"isGlobal":true}
find option: {"token":"--with-plugin","option":"with-plugin","value":"no","isGlobal":false}
parsed context: {
"optionValues": {
"capabilities": "declarative-agent",
"app-name": "HelloWorldDeclarativeAgent",
"programming-language": "typescript",
"folder": "HelloWorldTS10",
"with-plugin": "no",
"nonInteractive": true,
"correlationId": "d48fea02-7791-48b3-9583-043b98d7e2aa",
"platform": "cli"
},
"globalOptionValues": {
"interactive": false,
"debug": true,
"verbose": true
},
"argumentValues": [],
"telemetryProperties": {
"command-name": "teamsapp new",
"component": "cli",
"run-from": "Other",
"bin-name": "teamsapp",
"command-debug": "true",
"command-verbose": "true",
"command-help": "undefined",
"command-interactive": "false",
"command-version": "undefined"
}
}
sendTelemetryEvent ===> create-project-start, properties: {"bin-name":"teamsapp","command-name":"teamsapp new","component":"cli","run-from":"Other","command-debug":"true","command-verbose":"true","command-help":"undefined","command-interactive":"false","command-version":"undefined","success":"yes","correlation-id":"d48fea02-7791-48b3-9583-043b98d7e2aa"}, measurements: undefined
sendTelemetryEvent ===> askQuestion, properties: {"bin-name":"teamsapp","answerType":"skip","question":"project-type","platform":"cli","stage":"","correlation-id":"d48fea02-7791-48b3-9583-043b98d7e2aa","run-from":"Other"}, measurements: undefined
sendTelemetryEvent ===> askQuestion, properties: {"bin-name":"teamsapp","answerType":"skip","question":"capabilities","answer":"declarative-agent","platform":"cli","stage":"","correlation-id":"d48fea02-7791-48b3-9583-043b98d7e2aa","run-from":"Other"}, measurements: undefined
sendTelemetryEvent ===> askQuestion, properties: {"bin-name":"teamsapp","answerType":"skip","question":"with-plugin","answer":"no","platform":"cli","stage":"","correlation-id":"d48fea02-7791-48b3-9583-043b98d7e2aa","run-from":"Other"}, measurements: undefined
sendTelemetryEvent ===> askQuestion, properties: {"bin-name":"teamsapp","answerType":"skip","question":"folder","answer":"","platform":"cli","stage":"","correlation-id":"d48fea02-7791-48b3-9583-043b98d7e2aa","run-from":"Other"}, measurements: undefined
sendTelemetryEvent ===> askQuestion, properties: {"bin-name":"teamsapp","answerType":"skip","question":"app-name","answer":"","platform":"cli","stage":"","correlation-id":"d48fea02-7791-48b3-9583-043b98d7e2aa","run-from":"Other"}, measurements: undefined
sendTelemetryEvent ===> create-start, properties: {"bin-name":"teamsapp","appid":"","tenant-id":"","component":"coordinator","env":"","correlation-id":"d48fea02-7791-48b3-9583-043b98d7e2aa","run-from":"Other"}, measurements: {}
sendTelemetryEvent ===> generate-template-start, properties: {"bin-name":"teamsapp","appid":"","tenant-id":"","component":"copilot-extension-from-scratch-generator","env":"","correlation-id":"d48fea02-7791-48b3-9583-043b98d7e2aa","run-from":"Other"}, measurements: {}
Downloading app template "copilot-gpt-basic-ts" to D:\temp\examples-for-blog\HelloWorldTS10\HelloWorldDeclarativeAgent
Fetching zip from local: {"name":"copilot-gpt-basic","language":"ts","destination":"D:\temp\examples-for-blog\HelloWorldTS10\HelloWorldDeclarativeAgent","logProvider":{"logLevel":1}}
█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 6% | [1/1] Create: App template download in progress... (×) Failed.
sendTelemetryErrorEvent ===> generate-template, properties: {"bin-name":"teamsapp","appid":"","tenant-id":"","component":"copilot-extension-from-scratch-generator","env":"","template-name":"copilot-gpt-basic-ts","is-declarative-copilot":"true","is-microsoft-entra":"","need-add-plugin-from-existing":false,"success":"no","error-code":"gen.TemplateNotFoundError","error-type":"system","err-message":"Unable to find template: copilot-gpt-basic.","err-stack":"TemplateNotFoundError.toFxError | Object.templateDefaultOnActionError [as onActionError] | Generator.generate | async CopilotExtensionGenerator.scaffolding | async CopilotExtensionGenerator.run | async CopilotExtensionGenerator. | async Coordinator.create | async Coordinator. | async Coordinator. | async FxCore.createProject","error-name":"TemplateNotFoundError","error-component":"Coordinator","error-stage":"createProject","error-method":"create","error-source":"","correlation-id":"d48fea02-7791-48b3-9583-043b98d7e2aa","run-from":"Other"}, measurements: {}
sendTelemetryErrorEvent ===> create, properties: {"bin-name":"teamsapp","appid":"","tenant-id":"","component":"coordinator","env":"","capabilities":"declarative-agent","is-from-developer-portal":"false","success":"no","error-code":"gen.TemplateNotFoundError","error-type":"system","err-message":"Unable to find template: copilot-gpt-basic.","err-stack":"TemplateNotFoundError.toFxError | Object.templateDefaultOnActionError [as onActionError] | Generator.generate | async CopilotExtensionGenerator.scaffolding | async CopilotExtensionGenerator.run | async CopilotExtensionGenerator. | async Coordinator.create | async Coordinator. | async Coordinator. | async FxCore.createProject","error-name":"TemplateNotFoundError","error-component":"Coordinator","error-stage":"createProject","error-method":"create","error-source":"","correlation-id":"d48fea02-7791-48b3-9583-043b98d7e2aa","run-from":"Other"}, measurements: {}
sendTelemetryErrorEvent ===> create-project, properties: {"bin-name":"teamsapp","command-name":"teamsapp new","component":"cli","run-from":"Other","command-debug":"true","command-verbose":"true","command-help":"undefined","command-interactive":"false","command-version":"undefined","success":"no","new-project-id":"d91b7a63-43f6-4723-99eb-7cc6b096275e","is-creating-m365":"undefined","error-code":"gen.TemplateNotFoundError","error-type":"system","err-message":"Unable to find template: copilot-gpt-basic.","err-stack":"TemplateNotFoundError.toFxError | Object.templateDefaultOnActionError [as onActionError] | Generator.generate | async CopilotExtensionGenerator.scaffolding | async CopilotExtensionGenerator.run | async CopilotExtensionGenerator. | async Coordinator.create | async Coordinator. | async Coordinator. | async FxCore.createProject","error-name":"TemplateNotFoundError","error-component":"","error-stage":"","error-method":"","error-source":"","correlation-id":"d48fea02-7791-48b3-9583-043b98d7e2aa"}, measurements: undefined
(×) Error: gen.TemplateNotFoundError: Unable to find template: copilot-gpt-basic.
Call stack: TemplateNotFoundError: Unable to find template: copilot-gpt-basic.
at TemplateNotFoundError.toFxError (C:\Users\PaulBullock\AppData\Roaming\nvm\v18.20.4\node_modules@microsoft\teamsapp-cli\lib\index.js:2:2312260)
at Object.templateDefaultOnActionError [as onActionError] (C:\Users\PaulBullock\AppData\Roaming\nvm\v18.20.4\node_modules@microsoft\teamsapp-cli\lib\index.js:2:2402027)
at Generator.generate (C:\Users\PaulBullock\AppData\Roaming\nvm\v18.20.4\node_modules@microsoft\teamsapp-cli\lib\index.js:2:2401559)
at async CopilotExtensionGenerator.scaffolding (C:\Users\PaulBullock\AppData\Roaming\nvm\v18.20.4\node_modules@microsoft\teamsapp-cli\lib\index.js:2:2484548)
at async CopilotExtensionGenerator.run (C:\Users\PaulBullock\AppData\Roaming\nvm\v18.20.4\node_modules@microsoft\teamsapp-cli\lib\index.js:2:2482798)
at async CopilotExtensionGenerator. (C:\Users\PaulBullock\AppData\Roaming\nvm\v18.20.4\node_modules@microsoft\teamsapp-cli\lib\index.js:2:2568592)
at async Coordinator.create (C:\Users\PaulBullock\AppData\Roaming\nvm\v18.20.4\node_modules@microsoft\teamsapp-cli\lib\index.js:2:1799891)
at async Coordinator. (C:\Users\PaulBullock\AppData\Roaming\nvm\v18.20.4\node_modules@microsoft\teamsapp-cli\lib\index.js:2:2568592)
at async Coordinator. (C:\Users\PaulBullock\AppData\Roaming\nvm\v18.20.4\node_modules@microsoft\teamsapp-cli\lib\index.js:2:1701963)
at async FxCore.createProject (C:\Users\PaulBullock\AppData\Roaming\nvm\v18.20.4\node_modules@microsoft\teamsapp-cli\lib\index.js:2:2663881)

@microsoft-github-policy-service microsoft-github-policy-service bot added the needs attention This issue needs the attention of a contributor. label Jan 2, 2025
Copy link

👋 Hi @pkbullock,

Thank you for reporting this issue! We want to let you know that:

⏱️ Our team will personally review your issue
🎯 You can expect a response within 2 business days

✨ This is an AI-generated initial response
🤖 AI-Generated Preliminary Analysis:

Based on the error details provided, it appears that the Teams Toolkit CLI is unable to find the specified template copilot-gpt-basic when trying to generate your Teams app. The error code returned is gen.TemplateNotFoundError.

Steps to Resolve

  1. Verify Template Availability:

    • Ensure that the template copilot-gpt-basic is available in the version of the Teams Toolkit CLI you are using. Sometimes, template names or their availability can change between different versions of the toolkit.
  2. Update Teams Toolkit CLI:

    • Make sure you are using the latest version of the Teams Toolkit CLI. Run the following command to update:
      npm install -g @microsoft/teamsapp-cli
  3. Check Template List:

    • You can check the available templates by using the following command to ensure that copilot-gpt-basic is listed:
      teamsapp template list
  4. Correct Template Name:

    • If the template name has changed or is not available, update your command to use a valid template name. You might need to refer to the official documentation or the command output from the previous step.
  5. Manual Template Download (if needed):

    • If the template is not available through CLI, you might try downloading it manually and placing it in the appropriate directory. Refer to the Teams Toolkit GitHub repository for more information on available templates.

Example Command Adjustment

If the template name needs to be corrected:

teamsapp new --capability "declarative-agent" --app-name "HelloWorldDeclarativeAgent" -programming-language "typescript" -folder "HelloWorldTS10" --interactive false --debug --verbose --with-plugin no

Additional Resources

  • Teams Toolkit GitHub Repository: GitHub link
  • Teams Toolkit Documentation: Check for any updates or changes in template names and usage.

By ensuring that you are using the correct and available template, and that your CLI is up to date, you should be able to resolve the gen.TemplateNotFoundError and successfully generate your Teams app. If you continue to face issues, consider raising an issue on the Teams Toolkit GitHub for further assistance.


Note: This is an automated first response generated by AI. A human team member will review your issue and provide a more detailed response soon. We appreciate your patience!

@sayali-MSFT
Copy link

Thank you for your inquiry about your Teams app development issue!

We are checking the issue. We will get back to you shortly.

@sayali-MSFT
Copy link

Hello @pkbullock ,
Thank you for your patience! We were able to reproduce the issue. We have reported this as a bug for further investigation.

We will keep you updated as soon as we receive further information. Thank you for bringing this to our attention!

image

@jayzhang
Copy link
Member

jayzhang commented Jan 7, 2025

@pkbullock Thanks for reporting. The Declarative Agent without plugin has no laugnage option. You can delete -programming-language "typescript" and retry.

@jayzhang jayzhang closed this as completed Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigating needs attention This issue needs the attention of a contributor. TA:E2E Team Area: E2E
Projects
None yet
Development

No branches or pull requests

4 participants