Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not load file "[object Object]" #65

Open
piavan07 opened this issue Oct 11, 2018 · 10 comments
Open

Could not load file "[object Object]" #65

piavan07 opened this issue Oct 11, 2018 · 10 comments

Comments

@piavan07
Copy link

grpcc --proto ./Users/pavankumar/Downloads/synchronicity.proto --address tingle-grpc.synchronicity.ai:443
Error: Could not load file "[object Object]"
at Object.load (/Users/pavankumar/.npm-global/lib/node_modules/grpcc/node_modules/grpc/index.js:149:11)
at Object.deprecated [as load] (internal/util.js:70:15)
at createClient (/Users/pavankumar/.npm-global/lib/node_modules/grpcc/lib/index.js:57:21)
at Object. (/Users/pavankumar/.npm-global/lib/node_modules/grpcc/bin/grpcc.js:35:3)
at Module._compile (internal/modules/cjs/loader.js:678:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
at Module.load (internal/modules/cjs/loader.js:589:32)
at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
at Function.Module._load (internal/modules/cjs/loader.js:520:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:719:10)

@martin-stone
Copy link

I'm also getting this. Windows 7, Node 8.10.

@HugeTimor
Copy link

I have a same problem. You can use relative path, it work for me.

@wjcarpenter
Copy link

I also found that you could use "-d" in combination with a simple filename for "-p".

@PS-StuartZahn
Copy link

PS-StuartZahn commented Dec 17, 2018

grpcc --proto common/protos/service.proto --directory common/protos --address domain.com:443

Getting the same error with OSX.

Error: Could not load file "[object Object]"
at Object.load (/usr/local/share/.config/yarn/global/node_modules/grpc/index.js:148:11)
at Object.deprecated [as load] (internal/util.js:47:15)
at createClient (/usr/local/share/.config/yarn/global/node_modules/grpcc/lib/index.js:57:21)
at Object. (/usr/local/share/.config/yarn/global/node_modules/grpcc/bin/grpcc.js:35:3)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)

@roman-lemko
Copy link

This error means grpcc couldn't locate the proto file.
Although I'd really like it to say Error: Could not load file [FileName] instead.
E.g. specifying filename instead of [Object object]

@haozipang
Copy link

haozipang commented Apr 21, 2019

you can test like this:
grpcc –i -d D:FF/ --proto ./helloworld.proto --address 127.0.0.1:50051
-d, --directory path to a protobuf file directory
-p, --proto path to a protobuf file describing the service (required)

so maybe it is useful:
grpcc -d C:Users/pavankumar/Downloads/ --proto ./synchronicity.proto --address tingle-grpc.synchronicity.ai:443

@sitano
Copy link

sitano commented May 23, 2019

does not work for proto with includes:

$ grpcc -p ./api/grpc.proto -d ./api -a service:8000

@dylan-dinh
Copy link

This error means grpcc couldn't locate the proto file.
Although I'd really like it to say Error: Could not load file [FileName] instead.
E.g. specifying filename instead of [Object object]

Just go to file index.js and add JSON.stringify(filename) basically it prints the object which contains the directory path and filepath

@dylan-dinh
Copy link

Using

$ grpcc -p /Volumes/wholeDisk/libmed/ProtoObjects/postier.proto -d /Volumes/wholeDisk/libmed/ProtoObjects -a 127.0.0.1:4000 -i

print me out this error :
Error: Could not load file "{"root":"/Volumes/wholeDisk/libmed/ProtoObjects","file":"/Volumes/wholeDisk/libmed/ProtoObjects/postier.proto"}"

any tips ? Did everything above

@jlouazel
Copy link

jlouazel commented Jan 25, 2021

Going way after the battle, but I made it work by launching the tool in the same folder as the proto file. Doing otherwise would just throw me the error.

Hope it can help someone. Enjoy 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants