grpc-web not working in a Vite+Typescript app
See original GitHub issueI used protoc -I=. protos/*.proto --js_out=import_style=commonjs,binary:grpcproto_web/ --grpc-web_out=import_style=typescript,mode=grpcweb:grpcproto_web/
to generate my proto file.
Then whenever I try to import proto objects like import { LoginRequest } from '../protos/login_pb';
I get errors Uncaught SyntaxError: import not found: LoginRequest
.
I looked at issues #535 or vite#3898 but nothing works.
Does anyone have a working example using Vite+Typescript with grpc-web ?
Issue Analytics
- State:
- Created a year ago
- Reactions:14
- Comments:6
Top Results From Across the Web
does not provide an export named when using vite in grpc ...
I'm trying to use vite. I've some JavaScript-generated files for GRPC communication; alongside each file, there is a declarative file ...
Read more >Connect-Web: TypeScript library for calling RPC servers from ...
We use it at work, it does indeed address all of the concerns. The problem is gRPC, not protobuf. Twirp does not support...
Read more >Connect-Web: ergonomic Protobuf & gRPC for browsers
Hi r/typescript ! We've spent a few months working on a TypeScript RPC library and wanted to share. connect-web takes a Protocol Buffer ......
Read more >JavaScript Weekly Issue 618: December 9, 2022
You can even give it a quick spin online via vite.new. ... npm Gains New Security Features — GitHub continues its work in...
Read more >grpc - Bountysource
I looked at issues #535 or vite#3898 but nothing works. ... Does gRPC-Web Javascript client application supports gzip compression from gRPC .Net service?...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@loicmagne You can use
@protobuf-ts
andprotoc --ts_out ./generated --proto_path "./proto" <protoFilesPaths>
command. It works fine with Vite.I’m having the same issue. Sadly, I couldn’t get it to work. I also wasn’t able to get Vite+JS to work. Looks like this is some issue with how Vite loads external resources. 😞