I am attempting to use the Gremlin client in an Angular app, and all I am attempting to do (so far) is create a simple connection and return some vertices, like this:
getVerticesTest() {
const traversal = gremlin.process.AnonymousTraversalSource.traversal;
const g = traversal().withRemote(
new DriverRemoteConnection('ws://localhost:8182/gremlin'));
const vertices = g.V().valueMap();
return vertices;
}
However, when I trigger this method, here's what happens:
CanvasComponent.html:5 ERROR TypeError: crypto.randomBytes is not a function
at WebSocket.initAsClient (WebSocket.js:541)
at new WebSocket (WebSocket.js:72)
at Connection.open (connection.js:120)
at new Connection (connection.js:102)
at new Client (client.js:47)
at new DriverRemoteConnection (driver-remote-connection.js:53)
at GremlinService.push../src/app/services/gremlin.service.ts.GremlinService.getVerticesTest (gremlin.service.ts:13)
at CanvasComponent.push../src/app/components/canvas/canvas.component.ts.CanvasComponent.onClickMe (canvas.component.ts:43)
at Object.eval [as handleEvent] (CanvasComponent.html:5)
at handleEvent (core.js:23107)
Does this library have outdated dependencies? How do I use it?
(BTW, I am fully aware that my method leaks memory. I will fix that once I can establish a basic connection.)