Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

ReferenceError: proto is not defined

未关闭
#10 4 条评论 5 个 reaction 已指派 1 人 在 GitHub 查看

@dibenede 已经在做这个了。

开始于 2022年8月26日。

评估

这个 Issue 还没有评估数据。

描述

documentation good first issue javascript triaged

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

主要语言
JavaScript
星标
471
派生
91
平均合并
3 小时 57 分钟
30 天内合并 PR
2

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

protocolbuffers/protobuf-javascript 的其他 Issue

查看 protocolbuffers/protobuf-javascript 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。