Unable to find the relative path for the proto file: src/app/protos/greet.proto does not exist in the directory

https://i.sstatic.net/lxvWN.png

I recently attempted to create a gRPC Angular client by following the steps outlined in this article: here

During the process, I encountered an issue while running the command:

protoc --plugin=protoc-gen-ts="{ABSOLUTEPATH}\node_modules\.bin\protoc-gen-ts.cmd" 
       --js_out="import_style=commonjs,binary:src/app/generated" 
       --ts_out="service=grpc-web:src/app/generated" src/app/protos/greet.proto,

The error message displayed was:

Could not make proto path relative: src/app/protos/greet.proto: No such file or directory
. Despite confirming that the directory and greet.proto file do exist.

If anyone can offer assistance with resolving this issue, I would greatly appreciate it. Thank you in advance!

Answer №1

If you happen to come across this issue, the solution provided by the author can be helpful.

  1. Make sure to execute the command in the main project directory.
  2. Below is the updated command that resolved the issue:
protoc --plugin=protoc-gen-ts="C:/University/IT/Angular_grpc/angular-client/node_modules/ts-protoc-gen/bin/protoc-gen-ts.cmd" --js_out="import_style=commonjs,binary:src/app/generated" --ts_out="service=grpc-web:src/app/generated" src/app/protos/greet.proto

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Angular is showing an error indicating that the property "name" is not found on an empty object

After thorough checking, I have confirmed that the property does exist with the correct key. However, it is returning an error message stating name is not a property of {}. I attempted to assign this object to an interface along with its properties but enc ...

Break down the key:value objects into individual arrays

I'm currently working on an ionic project that involves handling an incoming array composed of key:value objects such as the one shown in the image below: https://i.stack.imgur.com/qrZiM.png My question is, can these values be separated into three d ...

A comprehensive guide to using Reactive Forms in Angular

I need help understanding how FormGroup, FormControl, FormArray work in Angular. The error message I'm encountering is: Type '{ question: FormControl; multi: true; choices: FormArray; }' is not assignable to type 'AbstractControl' ...

Ionic Troubleshoot: Issue with Reading Property

Encountering an error: A TypeError occurs: Cannot Read Property of "username" of Undefined The HTML code responsible for the error is as follows: <ion-content padding style="text-align: center; margin-top: 35px"> <form (ngSubmit)="logFor ...

Looking to dynamically modify the preselected rows in an Angular Slickgrid grid option when a button is clicked by calling a function (check)

When the button is clicked, certain specific rows are selected using a preselected grid option in Angular Slickgrid. However, if I do this, the preselected row in the grid options changes but it does not display properly. Please assist me. Typescript File ...

How do I go about adding <li> elements from component A to a favorites list in component B using Angular?

I'm currently working on a movie database project, and I'm trying to implement a feature where users can add movies from the "search-movie" component to a "favourites" component by clicking an "add to fav" button. I've been attempting to use ...

Something went wrong: You cannot use this command while the Angular CLI is running within a workspace

My angular project suddenly started showing the error message "Error: This command is not available when running the Angular CLI inside a workspace." Now, I can only use "ng serve" and not "ng n c". Any ideas on how to fix this? Angular Version: Angular C ...

The updateTag functionality in Angular fails to properly update meta tags within the HTML source view

Within my application, there is a requirement to update meta tags post completion of certain API request subscriptions. Initially, I included some tags in the ngInit method - addMetaTags(config){ this.title.setTitle(config.title); this.me ...

Leverage the retrieved configuration within the forRoot function

Currently working on an Angular app that uses @ngx-translate. In my implementation, I am using TranslateModule.forRoot(...) to set up a TranslateLoader: @NgModule({ imports: [ TranslateModule.forRoot({ loader: { provide: TranslateLoade ...

My postman is successfully uploading image files, but for some reason, my code isn't cooperating. Are there any adjustments that need to be made?

While attempting to upload an image file with form data in Angular, I encountered a discrepancy in behavior between Postman and my project. In Postman, under the headers section, I have configured the following: Content-Type: multipart/form-data, token: ...

Tips for ensuring a function in Angular is only executed after the final keystroke

I'm faced with the following input: <input type="text" placeholder="Search for new results" (input)="constructNewGrid($event)" (keydown.backslash)="constructNewGrid($event)"> and this function: construct ...

Exploring the functionalities of objects in Typescript through the use of the for...in loop

After successfully converting the JavaScript function to Typescript, I encountered an issue with the line if (!(key * key) in frequencyCounter2) {. The error message displayed was: "The left-hand side of an 'in' expression must be of type &a ...

Comparing ngrx and redux for managing state in stateless components

Exploring ngrx/angular 8 for the first time, I'm curious to know if the angular approach of using an observable to bind a state value to the this context still allows a component to remain presentational and stateless. In the realm of angular/ngrx, c ...

Utilize the parameters from the config.json file within the application

We've integrated the Google Maps API into our project and have generated a key for it. Currently, this key is hardcoded in one of our module files. However, we want to enhance security by moving this key into the config.json file. This way, when we pu ...

When invoking a JavaScript method, the context variable 'this' is lost

I have developed a basic pointer to a method like this: export class SmbwaService { getExistingArsByLab(labId: number): Observable<SmwbaAr[]> { this.otherMethod(); } otherMethod(): void { } } let method: (x: number) => ...

``Is there a specific location where I can access the Microsoft Azure msal sign-up feature within Angular

My current Angular version is 5.2.0 and I am struggling to find a tutorial on how to incorporate Azure MSAL for new user sign-up using a Microsoft account. If anyone has any resources or examples on how to achieve this integration without having to update ...

Angular 5 - Implementing Horizontal Scroll with Clickable Arrows

In my Angular application, I have successfully implemented horizontal scrolling of cards. Now, I am looking to enhance the user experience by adding "Left" and "Right" buttons that allow users to scroll in either direction within their specific msgCardDeck ...

Issue with Angular Testing: Tick function fails to work properly when component initialization includes a timer

Question How can I make the `tick` function work properly so that my test advances by 10s and calls `submit` in my component as expected? Note: I am looking for a solution other than using await new Promise(r => setTimeout(r, 10000)) to avoid having l ...

Using React's useState with WebSocket is causing the array to fail to update properly

Greetings, I am currently working on integrating WebSockets with react, and possibly electron as well. When the connection opens, the message 'Connection opened' is correctly added to the beginning of a new array and displayed as expected. Howe ...

What is the reasoning behind ngOnInit not being the initial lifecycle hook in Angular?

As a beginner in Angular 2, I'm curious about why ngOnInit is not the initial hook called after a component or directive's constructor? Reference: https://angular.io/docs/ts/latest/guide/lifecycle-hooks.html https://i.sstatic.net/aDJ5l.png ...