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

Getting error TypeError: Cannot read property 'createInsecure' of undefined #15

Closed
tahomatx opened this issue Dec 18, 2017 · 3 comments
Closed
Assignees
Labels
api: datastore Issues related to the googleapis/nodejs-datastore API. priority: p0 Highest priority. Critical issue. P0 implies highest priority. 🚨 This issue needs some love. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@tahomatx
Copy link

Hi,
Thank you for develop this library.

I got a error using datastore, so I wanna help.

Environment details

  • OS: Docker on Windows 10 (library/node docker image, not slim or alpine but standard)
  • Node.js version: 9.2.0
  • npm version: 5.5.1 (I'm using yarn 1.3.2)
  • @google-cloud/datastore version: 1.2.0

Steps to reproduce

  1. Set environment variable DATASTORE_EMULATOR_HOST=datastore:8081 to use emulator
  2. In my code, require('@google-cloud/datastore')();

I got error:

/node_modules/@google-cloud/datastore/src/index.js:400
    this.options.sslCreds = grpc.credentials.createInsecure();
                                             ^

TypeError: Cannot read property 'createInsecure' of undefined
    at new Datastore (/node_modules/@google-cloud/datastore/src/index.js:400:46)
    at Datastore (/node_modules/@google-cloud/datastore/src/index.js:366:12)
    at Object.<anonymous> (/app/test.js:3:35)
    at Module._compile (module.js:641:30)
    at Object.Module._extensions..js (module.js:652:10)
    at Module.load (module.js:560:32)
    at tryModuleLoad (module.js:503:12)
    at Function.Module._load (module.js:495:3)
    at Function.Module.runMain (module.js:682:10)
    at startup (bootstrap_node.js:191:16)

I think this stackoverflow question is the same issue.
https://stackoverflow.com/questions/47860766/google-cloud-datastore-cannot-read-property-createinsecure-of-undefined

Thanks for any help!

@callmehiphop callmehiphop added the type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. label Dec 18, 2017
@callmehiphop
Copy link
Contributor

@stephenplusplus I think this line is getting us in trouble here. I believe this returns a grpc wrapper and not an actual grpc instance. I think we can do this however

var grpc = require('google-gax').grpc().grpc;

WDYT?

@stephenplusplus
Copy link
Contributor

Ah, that's likely the problem then.

@stephenplusplus stephenplusplus added the priority: p0 Highest priority. Critical issue. P0 implies highest priority. label Dec 18, 2017
@stephenplusplus stephenplusplus self-assigned this Dec 18, 2017
@stephenplusplus stephenplusplus mentioned this issue Dec 18, 2017
@tahomatx
Copy link
Author

Thank you so much!!!!
ありがとう(^o^)

@google-cloud-label-sync google-cloud-label-sync bot added the api: datastore Issues related to the googleapis/nodejs-datastore API. label Jan 31, 2020
@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the googleapis/nodejs-datastore API. priority: p0 Highest priority. Critical issue. P0 implies highest priority. 🚨 This issue needs some love. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

4 participants