4

I have a very simple browser application, which has to use protobuf: https://github.com/dcodeIO/protobuf.js I also have a '.proto' file with a message format, so I just need to encode the incoming messages with protobuf.

Unfortunately I am not able to find, how to bind protobuf in my project. All I find is about node.js, which I am not using. I also find some information about using require.js to bind protobuf and wrote this in my script:

requirejs.config({
  paths: {
    protobuf:'//cdn.rawgit.com/dcodeIO/protobuf.js/6.8.6/dist/protobuf.js'
  }
});

But it seems to be wrong, as I getthis error in the console:

Uncaught Error: Mismatched anonymous define() module: function (Long) {
            if (Long && Long.isLong) {
                protobuf.util.Long = Long;
                protobuf.configure();
            }
            return protobuf;
        }

If there's anyone who has done anything similar, would you please give me a hand here?

Thanks

Natascha
  • 59
  • 1
  • 3
  • 8

0 Answers0