[Bug]: @typespec/http-client-csharp crashes due to missing package-name in tspconfig.yaml #6212
Open
4 tasks done
Labels
bug
Something isn't working
emitter:client:csharp
Issue for the C# client emitter: @typespec/http-client-csharp
Describe the bug
Bug Description
The emitter @typespec/http-client-csharp crashes during compilation when trying to generate a C# client.
The error message indicates that a required option package-name is missing in the configuration.
Error Message
Emitter "@typespec/http-client-csharp" crashed! This is a bug.
Please file an issue at https://github.com/Microsoft/typespec/issues
Error: Error: Failed to generate the library. Exit code: 1.
StackTrace:
Unable to parse required option package-name from configuration.
at Microsoft.TypeSpec.Generator.Configuration.ReadRequiredStringOption(JsonElement root, String option)
at Microsoft.TypeSpec.Generator.Configuration.Load(String outputPath, String json)
at Microsoft.TypeSpec.Generator.PluginHandler.LoadPlugin(CommandLineOptions options)
at Microsoft.TypeSpec.Generator.GeneratorRunner.RunAsync(CommandLineOptions options)
at Microsoft.TypeSpec.Generator.Program.Run(CommandLineOptions options, GeneratorRunner runner)
Steps to Reproduce
1.Initialize a new TypeSpec project
tsp init
2.Enable the C# client emitter in tspconfig.yaml
emit:
"@typespec/http-client-csharp": true
3.Run TypeSpec compilation
tsp compile .
4.The following error appears:
Unable to parse required option package-name from configuration.
Temporary Workaround
To avoid this error, I commented out @typespec/http-client-csharp in tspconfig.yaml, so it does not run during compilation:
emit:
Environment
TypeSpec Compiler Version: 0.65.3
@typespec/http-client-csharp Version: 0.1.9-alpha.20250228.1
Node.js Version: 20.10.0
Operating System: Windows 11
Reproduction
tspconfig.yaml
main.tsp
Checklist
The text was updated successfully, but these errors were encountered: