Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DeprecationWarning: grpc.load, Use the @grpc/proto-loader instead

I'm using node with google firebase and always I

(node:13556) DeprecationWarning: grpc.load: Use the @grpc/proto-loader module with grpc.loadPackageDefinition instead

my node version is a latest

$ node -v
v10.14.1
like image 770
Mahmoud Niypoo Avatar asked Dec 05 '18 17:12

Mahmoud Niypoo


1 Answers

npm install --save grpc

npm install --save @grpc/proto-loader

// replace - const notesProto = grpc.load('notes.proto');
// to

const grpc = require('grpc')
const protoLoader = require('@grpc/proto-loader')
const packageDefinition = protoLoader.loadSync('notes.proto');
const notesProto = grpc.loadPackageDefinition(packageDefinition);
like image 67
TechnoL0g Avatar answered Sep 28 '22 06:09

TechnoL0g