Dgraph-js (v 20.3.1) Channel credentials must be a ChannelCredentials object

Could you remove grpc = require("grpc") and try again?

Need not pass insecure channel here, since that is the default.

const clientStub = new dgraph.DgraphClientStub(
        "localhost:9080",
        grpc.credentials.createInsecure()
)