Skip to content

Has json-module with reflection changed since 6.8? #828

Open
@hnfmr

Description

@hnfmr

protobuf.js version: 6.8

I have been using protobuf.js to generate json-module with reflection information, it's been working fine until 6.7.3 and a recent upgrade to 6.8 is throwing errors.

For example I use the following command to generate json-module:

pbjs --target json-module -w commonjs --keep-case -o dest.js source.proto

The errors:

$ mocha test/protobuf.spec.js
/Users/xxx/xxx/node_modules/xxx/xxxx/dest.js:6
var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $protobuf.Root()))
                                                                         ^

TypeError: $protobuf.Root is not a constructor
    at Object.<anonymous> (/Users/xxx/xxx/node_modules/xxx/xxxx/dest.js:6:74)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)

Thanks!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions