Failed to compile. 'proto' is not defined (also 'COMPILED')
See original GitHub issueI’m using create-react-app with typescript and grpc-web, grpc & proto generated with command:
$(protoc) -I $(proto_dir) $(proto_dir)/ride.proto --js_out=import_style=commonjs:./rider/typescript/src/proto --grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:./rider/typescript/src/proto
App is not able to start, it throws tons of errors of form
Failed to compile.
./src/proto/ride_pb.js
Line 37: 'proto' is not defined no-undef
Line 40: 'proto' is not defined no-undef
Line 41: 'COMPILED' is not defined no-undef
Line 42: 'proto' is not defined no-undef
...
Issue Analytics
- State:
- Created 5 years ago
- Reactions:30
- Comments:20
Top Results From Across the Web
Unable to encode .proto file into binary using protoc compiler ...
I was not able to find any documentation on the type definitions used alongside --encode=.
Read more >How to avoid compiling protobuf compiler and use ...
The problem is that when the project compiles first time it also compiles a protobuf ... FAILED: Build did NOT complete successfully (0...
Read more >Python Generated Code | Protocol Buffers - Google Developers
The Python code generated by the protocol buffer compiler is completely unaffected by the package name defined in the .proto file. Instead, Python...
Read more >Protocol Buffers/gRPC Codegen Integration Into .NET Build
Also make sure not to include any file names to the Protobuf item collection, otherwise they will be compiled by default. If, by...
Read more >List of the armcc error and warning messages - Arm Developer
Compiling this with armcc -c foo.c defines TEST to be 0 (the default). ... A similar error is also raised if there is...
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
Maybe a better workaround is to ignore _pb.js files for eslint, which doesn’t require modifying the generated files every time (that gets old really fast).
Create a file called .env in your project root containing only
EXTEND_ESLINT=true
, then modify package.json to add ignorePatterns:Note that this is currently flagged experimental in the docs. Sources: https://create-react-app.dev/docs/setting-up-your-editor/ https://create-react-app.dev/docs/adding-custom-environment-variables/
Btw, I get the same compile errors and I am not using Typescript.
If I simply edit the generated files by adding the /* eslint-disable */ at the top just like @argoyb . Be nice if there was some code gen flag to emit this.