VueJS + Grpc-Web "Module not found: Error: Can't resolve"
See original GitHub issueI’ve created a fresh VueJS application with TypeScript functionality.
When I generate using:
protoc -I=. service.proto --js_out=import_style=typescript:. --grpc web_out=import_style=typescript,mode=grpcwebtext:.
I get the following files:
When I move them to src/_protos
in my VueJS project and try to import { PlatformClient } from '@/_protos/ServiceServiceClientPb';
it gives me the following error:
Failed to compile.
./src/_protos/ServiceServiceClientPb.ts
Module not found: Error: Can't resolve './service_pb' in '/Users/theobouwman/dev/woodyshousing/woody_web/src/_protos'
Why is this?
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
VueJS Grpc-Web module not found - Stack Overflow
I believe this is resolved in https://github.com/grpc/grpc-web/issues/431. In short, --js_out=import_style=typescript:. is not supposed to ...
Read more >Vuejs Grpc-Web Module Not Found - ADocLib
Fixed an issue where errors from grpc are thrown directly to user code. Added the missing type definitions for startAfter() and endBefore().
Read more >How to fix 'Module not found: Can't resolve 'http' in ... - YouTube
Basically, just change 'react-scripts' to 4.0.2 in your package.json and run `npm install` again :D Follow me on Twitter: ...
Read more >Import not found in VueJS/TypeScript with gRPC-Web-Vue.js
VueJS and FontAwesome Import - Module not found: Error: Can't resolve '@fortawesome/fontawesome-svg-core' · VueJS 3 Composition API and TypeScript type ...
Read more >@grpc/grpc-js - npm
Node 12 is recommended. The exact set of compatible Node versions can be found in the engines field of the package.json file. npm...
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
The
--js_out
parameter doesn’t supporttypescript
so what you actually want is:See: https://github.com/grpc/grpc-web/issues/411
--js_out=import_style=typescript:.
: this doesn’t work. The message part of the .proto generated byprotoc --js_out=
only supportsimport_style=commonjs
orimport_style=closure
. You need to use the former.--grpc-web_out=import_style=typescript
will output a minimal set of typings for the messages in a.d.ts
file.