We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
protobuf.js version: 6.8.0
We run this:
$ pbjs -t static-module -w es6 -o proto.js entity.proto
(Same thing with -w commongjs, by the way)
-w commongjs
Then import it like so in a JSX:
import { Entity } from 'proto.js'
Using babel, webpack emits the client code, using this babel configuration:
{ "presets":[ "es2015", "react" ] }
But when running in the browser, we get:
Uncaught ReferenceError: global is not defined at Object.<anonymous> (minimal.js:49) ...
Which is that line in minimal.js:
minimal.js
util.isNode = Boolean(global.process && global.process.versions && global.process.versions.node);
Now that makes sense, since we are in browser environment and not node.
I just wonder if we're doing something wrong, or should minimal.js not assume node environment?