Azure / Azure/autorest.powershell

Failed: New-DevTSPModule when generating new code for PostgreSQL Flexible Server

Open
#1,541 2 comments 1 reaction 1 assignee Claimed by @VeryEarly View on GitHub
Dominant language
C#
Stars
123
Forks
99
PR merge metrics
No merged PRs in 30d

Description

Following instructions defined here: [Azure PowerShell development using TypeSpec code generation
](https://eng.ms/docs/cloud-ai-platform/azure-core/azure-experiences-and-ecosystems/azure-portal-and-client-tools-ruhim/azure-cli-tools-azure-cli-powershell-and-terraform/azure-cli-tools/onboarding/azurepowershell/dev_guidance_codegen_tsp)

Failed trying to generate module:
`New-DevTSPModule -TSPLocation "https://github.com/Azure/azure-rest-api-specs/blob/be31c7768b25795ee6aadd24783100254499c845/specification/postgresql/DBforPostgreSQL.Management/tspconfig.yaml" -AzPSConfig "C:\Users\nasc\azure-powershell\src\PostgreSQLFlexibleServer\PostgreSQLFlexibleServer.Autorest\tspconfig.yaml"`

```
× Running @azure-tools/typespec-powershell...
Emitter "@azure-tools/typespec-powershell" crashed! This is a bug.
Please file an issue at https://github.com/Azure/autorest.powershell/issues
Error: Unknown Model. Fatal.
at SchemaDefinitionResolver.resolveTypeDeclaration (C:\Users\nasc\azure-powershell\src\PostgreSQLFlexibleServer\PostgreSQLFlexibleServer.Autorest\TempTypeSpecFiles\specification\postgresql\DBforPostgreSQL.Management\node_modules\@autorest\powershell\llcsharp\schema\schema-resolver.ts:149:11)
at ModelsNamespace.NewResolveTypeDeclaration (C:\Users\nasc\azure-powershell\src\PostgreSQLFlexibleServer\PostgreSQLFlexibleServer.Autorest\TempTypeSpecFiles\specification\postgresql\DBforPostgreSQL.Management\node_modules\@autorest\powershell\llcsharp\model\namespace.ts:92:33)
at ModelInterface.init (C:\Users\nasc\azure-powershell\src\PostgreSQLFlexibleServer\PostgreSQLFlexibleServer.Autorest\TempTypeSpecFiles\specification\postgresql\DBforPostgreSQL.Management\node_modules\@autorest\powershell\llcsharp\model\interface.ts:229:58)
at new ModelClass (C:\Users\nasc\azure-powershell\src\PostgreSQLFlexibleServer\PostgreSQLFlexibleServer.Autorest\TempTypeSpecFiles\specification\postgresql\DBforPostgreSQL.Management\node_modules\@autorest\powershell\llcsharp\model\model-class.ts:136:65)
at ModelsNamespace.NewResolveTypeDeclaration (C:\Users\nasc\azure-powershell\src\PostgreSQLFlexibleServer\PostgreSQLFlexibleServer.Autorest\TempTypeSpecFiles\specification\postgresql\DBforPostgreSQL.Management\node_modules\@autorest\powershell\llcsharp\model\namespace.ts:105:67)
at new ModelsNamespace (C:\Users\nasc\azure-powershell\src\PostgreSQLFlexibleServer\PostgreSQLFlexibleServer.Autorest\TempTypeSpecFiles\specification\postgresql\DBforPostgreSQL.Management\node_modules\@autorest\powershell\llcsharp\model\namespace.ts:54:14)
at Project.init (C:\Users\nasc\azure-powershell\src\PostgreSQLFlexibleServer\PostgreSQLFlexibleServer.Autorest\TempTypeSpecFiles\specification\postgresql\DBforPostgreSQL.Management\node_modules\@autorest\powershell\llcsharp\project.ts:104:28)
at llcsharpV2 (C:\Users\nasc\azure-powershell\src\PostgreSQLFlexibleServer\PostgreSQLFlexibleServer.Autorest\TempTypeSpecFiles\specification\postgresql\DBforPostgreSQL.Management\node_modules\@autorest\powershell\plugins\llcsharp-v2.ts:19:21)
at generatePwshModule (C:\Users\nasc\azure-powershell\src\PostgreSQLFlexibleServer\PostgreSQLFlexibleServer.Autorest\TempTypeSpecFiles\specification\postgresql\DBforPostgreSQL.Management\node_modules\@autorest\powershell\utils\tsp-generator.ts:67:3)
at generatePwshModel (file:///C:/Users/nasc/azure-powershell/src/PostgreSQLFlexibleServer/PostgreSQLFlexibleServer.Autorest/TempTypeSpecFiles/specification/postgresql/DBforPostgreSQL.Management/node_modules/@azure-tools/typespec-powershell/src/emitter.ts:73:7)
--------------------------------------------------
Library Version 0.0.376
TypeSpec Compiler Version 1.7.0
--------------------------------------------------
New-DevTSPModule: Failed to emit from TSP config [C:\Users\nasc\azure-powershell\src\PostgreSQLFlexibleServer\PostgreSQLFlexibleServer.Autorest\TempTypeSpecFiles\specification\postgresql\DBforPostgreSQL.Management\tspconfig.yaml]: One or more errors occurred. (Command 'node node_modules\@typespec\compiler\cmd\tsp compile ./ --emit @azure-tools/typespec-powershell --output-dir C:\Users\nasc\azure-powershell\src\PostgreSQLFlexibleServer\PostgreSQLFlexibleServer.Autorest' failed with exit code 1)
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.