I’m implementing gRPC between 2 servers.
the files are being generated perfectly, here is the generate-proto.ps1 file
# Ensure the script stops on the first error
$ErrorActionPreference = "Stop"
# Path to proto files
$protoDir = "srcserverproto"
# Path to generated files
$outDir = "$protoDirgenerated"
# Ensure the output directory exists
if (!(Test-Path -Path $outDir)) {
New-Item -Path $outDir -ItemType Directory
}
# Generate gRPC code
cmd /c "node_modules.bingrpc_tools_node_protoc --plugin=protoc-gen-ts=node_modules.binprotoc-gen-ts.cmd --ts_out=grpc_js:$outDir --grpc_out=grpc_js:$outDir --js_out=import_style=commonjs,binary:$outDir -I $protoDir $protoDir*.proto"
I generate these files by a script in package.json -> yarn run generate:proto
Scripts: {
// ... other default nest scripts
"generate:proto": "powershell.exe -ExecutionPolicy Bypass -File ./generate-proto.ps1"
}
The problem is, when I run “yarn run start:dev”, these generated files are not compiled into the dist folder.
this is the folder in my code
and this is the folder in the dist directory
as you can see, only the common_pb.ts file (which i wrote) has been compiled.