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

TypeError [ERR_INVALID_ARG_TYPE]: The "options.filename" property must be of type string. Received type object #55

Open
aep opened this issue May 7, 2018 · 10 comments

Comments

@aep
Copy link

aep commented May 7, 2018

this is not how you use eval?

aep@u8: grpcc --proto proto/0x.proto --insecure  --address 127.0.0.1:8080 --eval 'client.getIdentity({}, pr)'
TypeError [ERR_INVALID_ARG_TYPE]: The "options.filename" property must be of type string. Received type object
    at new Script (vm.js:57:13)
    at module.exports (/home/aep/.nvm/versions/node/v10.0.0/lib/node_modules/grpcc/node_modules/eval/eval.js:68:18)
    at init (/home/aep/.nvm/versions/node/v10.0.0/lib/node_modules/grpcc/lib/index.js:152:5)
    at prepareClient (/home/aep/.nvm/versions/node/v10.0.0/lib/node_modules/grpcc/lib/index.js:44:3)
    at createClient (/home/aep/.nvm/versions/node/v10.0.0/lib/node_modules/grpcc/lib/index.js:82:12)
    at Object.<anonymous> (/home/aep/.nvm/versions/node/v10.0.0/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)

the same works fine with interactive mode

grpcc --proto proto/0x.proto --insecure  --address 127.0.0.1:8080        

Connecting to zeroxproto.v1.Bearer on 127.0.0.1:8080. Available globals:

  client - the client connection to Bearer
    getIdentity (Empty, callback) returns IdentityReply

  printReply - function to easily print a unary call reply (alias: pr)
  streamReply - function to easily print stream call replies (alias: sr)
  createMetadata - convert JS objects into grpc metadata instances (alias: cm)
  printMetadata - function to easily print a unary call's metadata (alias: pm)

Bearer@127.0.0.1:8080> client.getIdentity({}, pr)
EventEmitter {}
Bearer@127.0.0.1:8080> (node:32638) [DEP0079] DeprecationWarning: Custom inspection function on Objects via .inspect() is deprecated

{
  "hostname": "none",
  "version": 1,
  "head": ""
}
@AlexanderBinkovsky
Copy link

same issue happens on node v10.1.0, grpcc @1.1.3 grpc@1.11.3

@wawa19933
Copy link

wawa19933 commented Jun 13, 2018

I have an issue as well, when using -x testRpc.js option

  • node v10.4.1
  • grpcc @1.1.3
  • grpc@1.12.2

Error message the same

@vipkum2
Copy link

vipkum2 commented Jun 29, 2018

I am also getting same-
hax-vipkumar-1|/gitRepo/grpcc$ ./bin/grpcc.js --insecure --proto ./test/test.proto --address 192.168.0.88:10161 --exec ./examples/unary.js
TypeError [ERR_INVALID_ARG_TYPE]: The "options.filename" property must be of type string. Received type object
at new Script (vm.js:57:13)
at module.exports (/home/vipkumar/gitRepo/grpcc/node_modules/eval/eval.js:68:18)
at init (/home/vipkumar/gitRepo/grpcc/lib/index.js:152:5)
at prepareClient (/home/vipkumar/gitRepo/grpcc/lib/index.js:44:3)
at createClient (/home/vipkumar/gitRepo/grpcc/lib/index.js:82:12)
at Object. (/home/vipkumar/gitRepo/grpcc/bin/grpcc.js:35:3)
at Module._compile (internal/modules/cjs/loader.js:702:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
at Module.load (internal/modules/cjs/loader.js:612:32)
at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
hax-vipkumar-1|~/gitRepo/grpcc$

@tulequ
Copy link

tulequ commented Aug 27, 2018

try this patch tulequ@e424f74
or just try my fork :)

@aep
Copy link
Author

aep commented Oct 29, 2018

@mrlequoctuan your fork works nicely, but you have issues disabled. are you planning to release on npm?

@tulequ
Copy link

tulequ commented Nov 1, 2018

@aep Enabled

Currently, I have no plan to release on npm
But I think it should be use as an docker image https://hub.docker.com/r/lequoctuan/grpcc/
No need to install at all :)

@malcolmsgroves
Copy link

Using node 8 seems to be a valid workaround

@alex-lzl
Copy link

try this patch mrlequoctuan@e424f74
or just try my fork :)

Your fork saves the day for me! It also fixed unary callback (broken in 1.1.3 here). Thank you!

@Matan
Copy link

Matan commented Jan 24, 2019

For anyone using the node:10-alpine docker and installing grpcc globally. Patch like this:

RUN apk add --no-cache --virtual .grpcc-patch curl git  \
    && cd /usr/local/share/.config/yarn/global/node_modules/grpcc \
    && curl -s https://github.com/mrlequoctuan/grpcc/commit/e424f74cf39a4894b41f797b28a8224e38abd731.patch | git apply \
    && apk del .grpcc-patch

@J7mbo
Copy link

J7mbo commented Apr 20, 2019

Why is this still not merged or fixed?

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

9 participants