Skip to content

Commit 7a70aa3

Browse files
committed
fix: Import issues when used by consumers
1 parent 5440b3d commit 7a70aa3

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/client.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ const supportedReflectionAPIVersions = {
2424
v1alpha: {
2525
priority: 0,
2626
serviceName: 'grpc.reflection.v1alpha.ServerReflection',
27-
client: './reflection_providers/v1alpha/reflection_pb',
28-
service: './reflection_providers/v1alpha/reflection_grpc_pb',
27+
client: import('./reflection_providers/v1alpha/reflection_pb'),
28+
service: import('./reflection_providers/v1alpha/reflection_grpc_pb'),
2929
},
3030
v1: {
3131
priority: 1,
3232
serviceName: 'grpc.reflection.v1.ServerReflection',
33-
client: './reflection_providers/v1/reflection_pb',
34-
service: './reflection_providers/v1/reflection_grpc_pb',
33+
client: import('./reflection_providers/v1/reflection_pb'),
34+
service: import('./reflection_providers/v1/reflection_grpc_pb'),
3535
},
3636
};
3737

@@ -114,11 +114,14 @@ export class Client {
114114
supportedReflectionAPIVersions[
115115
version as keyof typeof supportedReflectionAPIVersions
116116
];
117-
const {service: servicePath, client: clientPath} = protocolConfig;
117+
const {
118+
service: servicePromise,
119+
client: clientPromise,
120+
} = protocolConfig;
118121

119122
const [protocolService, protocolClient] = await Promise.all([
120-
import(servicePath),
121-
import(clientPath),
123+
servicePromise,
124+
clientPromise,
122125
]);
123126

124127
const grpcClientForProtocol = new protocolService.ServerReflectionClient(

0 commit comments

Comments
 (0)