You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
npm install google-protobuf under the root directory.
node test.js
// test.jsvarid_pb=require('./build/id_pb');varproject_pb=require('./build/project_pb');varid=newid_pb.Id();id.setValue("Everything is fine");varproject=newproject_pb.Project()project.setId(id);process.stdout.write(project.getId().getValue());process.stdout.write("\n");
Expected behaviour
Everything is fine is printed to the console.
Actual behaviour
.../test-proto/build/project_pb.js:173
jspb.Message.getWrapperField(this, id_pb.Id, 1));
^
ReferenceError: id_pb is not defined
at proto.Project.getId (.../test-proto/build/project_pb.js:173:40)
at Object.<anonymous> (.../test-proto/test.js:10:30)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
at startup (internal/bootstrap/node.js:285:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)
id_pb import is missing from project_pb. Alternatively it may be referenced from task_pb, since it’s declared public in task.proto.
The error does not show up if id.proto is explicitly imported in project.proto.
The text was updated successfully, but these errors were encountered:
System
Version: v3.6.1
Language: Javascript
macOS 10.14
Steps to reproduce
src
directory with 3 files:npm install google-protobuf
under the root directory.node test.js
Expected behaviour
Everything is fine
is printed to the console.Actual behaviour
id_pb
import is missing fromproject_pb
. Alternatively it may be referenced fromtask_pb
, since it’s declared public intask.proto
.The error does not show up if
id.proto
is explicitly imported inproject.proto
.The text was updated successfully, but these errors were encountered: