grpc / grpc-web

gRPC for Web Clients
https://grpc.io
Apache License 2.0
8.56k stars 762 forks source link

Pin typescript @`4.4.4` to fix CI #1170

Closed sampajano closed 2 years ago

sampajano commented 2 years ago

CI broke today due to typescript updating to 4.5.2 (release notes). Pinning it down to 4.4.4 to fix CI.

It appears that 4.5.2 stop generating echo_grpc_web_pb.js and echo_pb.js files in the dist/ directory, despite there being corresponding .d.ts files.

Ideas on why and a proper fix (e.g. maybe we should just copy the files into dist/ ourselves?) are very welcome.. :)

sampajano commented 2 years ago

Here's the error log when build failed in 4.5.2:

...

ERROR in ./dist/client.js
Module not found: Error: Can't resolve './echo_grpc_web_pb' in '/github/grpc-web/net/grpc/gateway/examples/echo/ts-example/dist'
 @ ./dist/client.js 24:27-56

ERROR in ./dist/client.js
Module not found: Error: Can't resolve './echo_pb' in '/github/grpc-web/net/grpc/gateway/examples/echo/ts-example/dist'
 @ ./dist/client.js 27:18-38
Service 'ts-client' failed to build: The command '/bin/sh -c npm install &&   npm link grpc-web &&   tsc &&   npx webpack &&   cp echotest.html /var/www/html &&   cp dist/main.js /var/www/html/dist' returned a non-zero code: 2

It appears that tsc in 4.5.2 stop generating echo_grpc_web_pb.js and echo_pb.js into the dist/ directory.