Heads-up: Apologies for the noob question. I've a limited understanding of Closure Library (long-term user of the Compiler service). I assume the general pattern is to use this for Node.JS runtimes but the documentation states that "browsers can be supported using ... webpack ...". The grpc.io and grpc-web documentation default to CommonJS.
What version of protobuf and what language are you using?
protoc --version
libprotoc 3.7.1
server: Golang
clients: Golang, JavaScript
What operating system (Linux, Windows, ...) and version?
Debian
What runtime / compiler are you using (e.g., python version or gcc version)
Expect to be able to build-run the Closure sample similarly to CommonJS
What did you see instead?
npx webpack client.js
Hash: 3ecf416ccfa5f9e1385d
Version: webpack 4.32.0
Time: 6433ms
Built at: 05/22/2019 11:51:01 AM
1 asset
Entrypoint main = main.js
[2] (webpack)/buildin/global.js 472 bytes {0} [built]
[939] ./client.js 2.36 KiB {0} [built]
[943] ./node_modules/google-closure-library/closure/goog sync ^\.\/.*$ 53.1 KiB {0} [built]
+ 1049 hidden modules
[[DELETED: WARNING in ./node_modules/google-closure-library/closure/goog/... ]]
ERROR in ./node_modules/google-closure-library/closure/goog/bootstrap/nodejs.js
Module not found: Error: Can't resolve 'fs' in '[[PATH]]/go/src/google.golang.org/grpc/examples/helloworld/greeter_client_js/node_modules/google-closure-library/closure/goog/bootstrap'
@ ./node_modules/google-closure-library/closure/goog/bootstrap/nodejs.js 43:9-22
@ ./client.js
ERROR in ./node_modules/google-closure-library/closure/goog/promise/testsuiteadapter.js
Module not found: Error: Can't resolve 'promises_aplus_tests' in '[[PATH]]/go/src/google.golang.org/grpc/examples/helloworld/greeter_client_js/node_modules/google-closure-library/closure/goog/promise'
@ ./node_modules/google-closure-library/closure/goog/promise/testsuiteadapter.js 33:4-35
@ ./node_modules/google-closure-library/closure/goog sync ^\.\/.*$
@ ./node_modules/google-closure-library/closure/goog/bootstrap/nodejs.js
@ ./client.js
ERROR in main.js from Terser
module redeclared [main.js:92560,6]
I tried adding "promises-aplus-tests": "^2.1.2" to package.json but this makes no different and reports a critical vuln in growl and a high vulnerability in minimatch.
Anything else we should know about your project / environment
Heads-up: Apologies for the noob question. I've a limited understanding of Closure Library (long-term user of the Compiler service). I assume the general pattern is to use this for Node.JS runtimes but the documentation states that "browsers can be supported using ... webpack ...". The grpc.io and grpc-web documentation default to CommonJS.
What version of protobuf and what language are you using?
server: Golang clients: Golang, JavaScript
What operating system (Linux, Windows, ...) and version?
Debian
What runtime / compiler are you using (e.g., python version or gcc version)
What did you do?
I'm exploring gRPC-Web.
CommonJS (Working)
The CommonJS flow works flawlessly for the HelloWorld sample.
NB I added
google/api/annotations
to the proto and must remove these using CommonJS.and:
with:
Followed by:
Closure (Not Working)
I tried using Closure instead of CommonJS but am unable to it to work:
and:
What did you expect to see
Expect to be able to build-run the Closure sample similarly to CommonJS
What did you see instead?
I tried adding
"promises-aplus-tests": "^2.1.2"
to package.json but this makes no different and reports a critical vuln ingrowl
and a high vulnerability inminimatch
.Anything else we should know about your project / environment