Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
299 views
in Technique[技术] by (71.8m points)

javascript - 从Protobuf生成.js文件不起作用(Generate .js files from Protobuf doesn't work)

  • I worked with ES6.

    (我使用ES6。)

  • Installed is protoc-3.10.1-win64

    (安装的是protoc-3.10.1-win64)

  • Files are created with the following arguments:

    (使用以下参数创建文件:)

protoc 
    --js_out=import_style=browser,binary:../../../build/generated/source/proto/main/js 
    --java_out=../../../build/generated/source/proto/main/java
    --proto_path=.
    Admin.proto
    Barkeeper.proto
    Barowner.proto
    Customer.proto
    Person.proto
    Proto.proto

I have the problem that my generated .js files from Protobuf include errors:

(我有一个问题,我从Protobuf生成的.js文件包含错误:)

...
// GENERATED CODE -- DO NOT EDIT!

goog.exportSymbol('proto.person.LoginStatus', null, global);
goog.exportSymbol('proto.person.Request', null, global);
...

WebStorm underlines goog.exportSymbol and shows the messsage: " Unresolved variable or type goog " When I try to run a html file which includes the generated js file, the Edge Browser shows a similar error Message.

(WebStorm在goog.exportSymbol下划线并显示以下消息:“ 未解析的变量或键入goog ”当我尝试运行包含生成的js文件的html文件时,边缘浏览器会显示类似的错误消息。)

Can anybody tell me why "goog" is unresolved?

(谁能告诉我为什么“ goog”无法解决?)

Thanks for your help

(谢谢你的帮助)

Kind regards Simon

(亲切的问候西蒙)

  ask by Simon translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...