protocolbuffers / protocolbuffers/protobuf-javascript

ReferenceError: proto is not defined

Open
#10 4 comments 5 reactions 1 assignee View on GitHub

@dibenede is already working on this.

Since Aug 26, 2022.

documentation good first issue javascript triaged
Dominant language
JavaScript
Stars
471
Forks
91
Avg merge
3h 57m
Merged PRs (30d)
2

Description

What version of protobuf and what language are you using?
Version: Protocol Buffers v3.19.4
Language: Javascript

What operating system (Linux, Windows, ...) and version?
Linux Debian 11

What runtime / compiler are you using (e.g., python version or gcc version)
Node v12, Node v16

What did you do?
Steps to reproduce the behavior:

  1. Install protoc through Debian package system
  2. Install google/protobufer
  3. Define two different correct ".proto" files
  4. Import one file to another with "import" statement
  5. Run protoc with "protoc --proto_path=./ --js_out=import_style=commonjs,binary:./ *.proto"
  6. JS code is generated, for file that is importing

var something_pb = require('./something_pb.js'); goog.object.extend(proto, something_pb);

7: Import generated files as javascript code:
require("./proto/hello_pb")

  1. Run the code

What did you expect to see

Everything goes fine

What did you see instead?

goog.object.extend(proto, core_pb); ^ ReferenceError: proto is not defined

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.