diff --git a/packages/middleware-endpoint-discovery/src/endpointDiscoveryMiddleware.ts b/packages/middleware-endpoint-discovery/src/endpointDiscoveryMiddleware.ts index 687b82eb7701..ed8146299c4c 100644 --- a/packages/middleware-endpoint-discovery/src/endpointDiscoveryMiddleware.ts +++ b/packages/middleware-endpoint-discovery/src/endpointDiscoveryMiddleware.ts @@ -28,7 +28,8 @@ export const endpointDiscoveryMiddleware = const { endpointDiscoveryCommandCtor } = config; const { isDiscoveredEndpointRequired, identifiers } = middlewareConfig; - const { clientName, commandName } = context; + const clientName = context.clientName!; + const commandName = context.commandName!; const isEndpointDiscoveryEnabled = await config.endpointDiscoveryEnabled(); const cacheKey = await getCacheKey(commandName, config, { identifiers });