Skip to content

root-client-missing-service

Id
@azure-tools/typespec-client-generator-core/root-client-missing-service

Severity: error

This diagnostic is issued when a root namespace decorated with @client does not specify a service configuration.

  • Area: Root client construction. Blocks building an explicit root client because TCGC cannot determine which service metadata it represents.
  • Not affected: The service namespace itself remains valid.
@client // root client is missing `{ service: ... }`
namespace WidgetClient {
}

TCGC reports:

Root namespace decorated with @client must have service config.

Add the service option to the root @client, or make the client nested under a parent client whose services it should inherit:

@service
namespace WidgetService;
@client({
service: WidgetService,
})
namespace WidgetClient {
}