Open prudd42 opened 5 years ago
I have the same problem. It previously worked fine, and currently just can't generate the right d.ts. Have tried rebuilding the project, rolling back the typescript, which don't work.
same problem + 1
I made a simple script to generate *.d.ts, to solve this problem for my usage https://gist.github.com/springhack/f69a7e9bd27e40e5fbf2dc6d6cffd65e
same problem + 1 @dcodeIO
Shot in the dark: There has been some trouble with jsdoc lately due to incompatibilities of one of its dependencies with node 12. Are the environments identical? Same node version etc.? Same package versions in node_modules?
Shot in the dark: There has been some trouble with jsdoc lately due to incompatibilities of one of its dependencies with node 12. Are the environments identical? Same node version etc.? Same package versions in node_modules?
My environments are: node version: 8.15.0 protobuf.js version: 6.6.8 still got this problem
Shot in the dark: There has been some trouble with jsdoc lately due to incompatibilities of one of its dependencies with node 12. Are the environments identical? Same node version etc.? Same package versions in node_modules?
node version v8.11.3 protobuf.js version v6.6.8
Shot in the dark: There has been some trouble with jsdoc lately due to incompatibilities of one of its dependencies with node 12. Are the environments identical? Same node version etc.? Same package versions in node_modules?
Node version: 10.15.1 NPM version: 6.4.1 ProtobufJS version: ^6.8.8
I am having the same issue. Just moved to a new install. It's pretty inconsistent, as some protobufs will get interfaces generated for them while other do not.
@dcodeIO It's definitely caused by some breaking changes in jsdoc
. I use jsdoc 3.5.5 to replace the jsdoc 3.6.2 in protobufjs/cli/node_modules
, and the result is correct.
Quick and dirty fix: fork and change jsdoc
's version from ^3.5.5
to ~3.5.5
(at devDependencies
in package.json
file). Then install the forked version to install the correct version of jsdoc
.
I've forked the repo, and can be installed using:
npm install --save protobufjs@github:iFwu/protobuf.js
Shot in the dark: There has been some trouble with jsdoc lately due to incompatibilities of one of its dependencies with node 12. Are the environments identical? Same node version etc.? Same package versions in node_modules?
Node version: v8.16.0 NPM version: 6.4.1 ProtobufJS version: 6.8.8
Quick and dirty fix: fork and change
jsdoc
's version from^3.5.5
to~3.5.5
(atdevDependencies
inpackage.json
file). Then install the forked version to install the correct version ofjsdoc
.I've forked the repo, and can be installed using:
npm install --save protobufjs@github:iFwu/protobuf.js
Method signatures are now messed up:
public memberName [ 'Array' ].<MemberType>;
public static verify(message: [ 'object' ].<string, any>): (string|null);
public toJSON(): [ 'object' ].<string, any>;
Quick and dirty fix: fork and change
jsdoc
's version from^3.5.5
to~3.5.5
(atdevDependencies
inpackage.json
file). Then install the forked version to install the correct version ofjsdoc
. I've forked the repo, and can be installed using:npm install --save protobufjs@github:iFwu/protobuf.js
Method signatures are now messed up:
public memberName [ 'Array' ].<MemberType>; public static verify(message: [ 'object' ].<string, any>): (string|null); public toJSON(): [ 'object' ].<string, any>;
Can you provide more specific proto
file and the d.ts
output? I've tried and not found such code.
I found that downgrading to node 11 (from 12) fixed the issue. Protobufjs works for me on node 11 with the jsdoc dependency fix.
any updates on this? I'm experiencing the same issues
This is not only an issue on Linux / Mac as the title states.
I'm experiencing this as well :/
Edit: It seems to give different results based on where the proto messages / enums is defined?
Order of these matters. Example:
enum BaseEnum {
example = 4000
}
message BaseMessage {
optional fixed64 id = 1;
}
System: Windows 10 Pro 32gb ram Intel Core i7-6700k
Versions: Protobuf.js: 6.10.1 NodeJS: 14.8.0 Yarn: 1.7.0
There is a PR with a fix in Jsdoc resolving this issue.
Go show it some love.
It is still to this day not fixed (the jsdoc PR is still not accepted), I am curious to know why.
@antonstjernquist my grain of salt:
Don't change anything about your .proto files, simply move all the @enum
annoted enum exports to the end of your pbjs
common.js bundle before running pbts
(no reason to alter .proto files / imports integrity)
It is still to this day not fixed (the jsdoc PR is still not accepted), I am curious to know why. @antonstjernquist my grain of salt: Don't change anything about your .proto files, simply move all the
@enum
annoted enum exports to the end of yourpbjs
common.js bundle before runningpbts
(no reason to alter .proto files / imports integrity)
@pde-rent I just forked the fix and generated the files correctly. 😅 The .proto files I'm using are generated so there would be a lot of work just moving the enums unfortunately.
@pde-rent @antonstjernquist It's amazing, but I am wondering if there is anyone maintain protobufjs ? The issue has been raised two years ago....
But for protobufjs's ability to convert key-value into binary data, I think I would have used google-protobuf.
@dcodeIO this one just hit me in the jugular, any news?
protobuf.js version: 6.6.8 nodejs version 11.6 yarn version 1.12 angular-cli version 7.3.6
When compiling our proto file on Linux or Mac the resulting typescript file is missing the needed interfaces for various classes. Yet when we run the same script on Windows (using 'git version 2.19.1.windows.1' as the shell on Windows) the interfaces are there as expected. This results in the ng build failing on Linux or Mac but succeeding on Windows.
Proto File
```proto syntax = "proto3"; option csharp_namespace = "ActiveFloor.Messages.Scores"; enum PlayerColor { RED = 0; BLUE = 1; GREEN = 2; YELLOW = 3; PURPLE = 4; } message PlayerScore { PlayerColor player = 1; sint32 score = 2; } message Scores { repeated PlayerScore scores = 1; } message HighScores { repeated sint32 highScores = 1; } ```Compilation Script
```sh #!/bin/sh SOURCE_DIR="src/app/messages" BUILD_DIR="src/app/models" # Remove old build products [ -e $BUILD_DIR/ProtocolBufferMessages.js ] && rm $BUILD_DIR/ProtocolBufferMessages.js [ -e $BUILD_DIR/ProtocolBufferMessages.d.ts ] && rm $BUILD_DIR/ProtocolBufferMessages.d.ts # Make sure the directory where we will put the files exists. mkdir -p $BUILD_DIR # Compile the Protocol Buffer files. yarn run pbjs -t static-module -w commonjs -o $BUILD_DIR/ProtocolBufferMessages.js \ $SOURCE_DIR/ScoreMessages/ScoreMessages.proto \ yarn run pbts -o $BUILD_DIR/ProtocolBufferMessages.d.ts $BUILD_DIR/ProtocolBufferMessages.js ```Intermediate JavaScript file on Linux or Mac
```js /*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ "use strict"; var $protobuf = require("protobufjs/minimal"); // Common aliases var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); /** * PlayerColor enum. * @exports PlayerColor * @enum {string} * @property {number} RED=0 RED value * @property {number} BLUE=1 BLUE value * @property {number} GREEN=2 GREEN value * @property {number} YELLOW=3 YELLOW value * @property {number} PURPLE=4 PURPLE value */ $root.PlayerColor = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "RED"] = 0; values[valuesById[1] = "BLUE"] = 1; values[valuesById[2] = "GREEN"] = 2; values[valuesById[3] = "YELLOW"] = 3; values[valuesById[4] = "PURPLE"] = 4; return values; })(); $root.PlayerScore = (function() { /** * Properties of a PlayerScore. * @exports IPlayerScore * @interface IPlayerScore * @property {PlayerColor|null} [player] PlayerScore player * @property {number|null} [score] PlayerScore score */ /** * Constructs a new PlayerScore. * @exports PlayerScore * @classdesc Represents a PlayerScore. * @implements IPlayerScore * @constructor * @param {IPlayerScore=} [properties] Properties to set */ function PlayerScore(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * PlayerScore player. * @member {PlayerColor} player * @memberof PlayerScore * @instance */ PlayerScore.prototype.player = 0; /** * PlayerScore score. * @member {number} score * @memberof PlayerScore * @instance */ PlayerScore.prototype.score = 0; /** * Creates a new PlayerScore instance using the specified properties. * @function create * @memberof PlayerScore * @static * @param {IPlayerScore=} [properties] Properties to set * @returns {PlayerScore} PlayerScore instance */ PlayerScore.create = function create(properties) { return new PlayerScore(properties); }; /** * Encodes the specified PlayerScore message. Does not implicitly {@link PlayerScore.verify|verify} messages. * @function encode * @memberof PlayerScore * @static * @param {IPlayerScore} message PlayerScore message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ PlayerScore.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.player != null && message.hasOwnProperty("player")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.player); if (message.score != null && message.hasOwnProperty("score")) writer.uint32(/* id 2, wireType 0 =*/16).sint32(message.score); return writer; }; /** * Encodes the specified PlayerScore message, length delimited. Does not implicitly {@link PlayerScore.verify|verify} messages. * @function encodeDelimited * @memberof PlayerScore * @static * @param {IPlayerScore} message PlayerScore message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ PlayerScore.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a PlayerScore message from the specified reader or buffer. * @function decode * @memberof PlayerScore * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {PlayerScore} PlayerScore * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ PlayerScore.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.PlayerScore(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.player = reader.int32(); break; case 2: message.score = reader.sint32(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a PlayerScore message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof PlayerScore * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {PlayerScore} PlayerScore * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ PlayerScore.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a PlayerScore message. * @function verify * @memberof PlayerScore * @static * @param {Object.Resulting TypeScript file on Linux or Mac
```ts import * as $protobuf from "protobufjs"; /** PlayerColor enum. */ namespace PlayerColor { /** RED value */ let RED: number; /** BLUE value */ let BLUE: number; /** GREEN value */ let GREEN: number; /** YELLOW value */ let YELLOW: number; /** PURPLE value */ let PURPLE: number; } /** Represents a PlayerScore. */ export class PlayerScore implements IPlayerScore { /** * Constructs a new PlayerScore. * @param [properties] Properties to set */ constructor(properties?: IPlayerScore); /** PlayerScore player. */ public player: PlayerColor; /** PlayerScore score. */ public score: number; /** * Creates a new PlayerScore instance using the specified properties. * @param [properties] Properties to set * @returns PlayerScore instance */ public static create(properties?: IPlayerScore): PlayerScore; /** * Encodes the specified PlayerScore message. Does not implicitly {@link PlayerScore.verify|verify} messages. * @param message PlayerScore message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ public static encode(message: IPlayerScore, writer?: $protobuf.Writer): $protobuf.Writer; /** * Encodes the specified PlayerScore message, length delimited. Does not implicitly {@link PlayerScore.verify|verify} messages. * @param message PlayerScore message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ public static encodeDelimited(message: IPlayerScore, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes a PlayerScore message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand * @returns PlayerScore * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): PlayerScore; /** * Decodes a PlayerScore message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from * @returns PlayerScore * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): PlayerScore; /** * Verifies a PlayerScore message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** * Creates a PlayerScore message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns PlayerScore */ public static fromObject(object: { [k: string]: any }): PlayerScore; /** * Creates a plain object from a PlayerScore message. Also converts values to other types if specified. * @param message PlayerScore * @param [options] Conversion options * @returns Plain object */ public static toObject(message: PlayerScore, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this PlayerScore to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } /** Represents a Scores. */ export class Scores implements IScores { /** * Constructs a new Scores. * @param [properties] Properties to set */ constructor(properties?: IScores); /** Scores scores. */ public scores: IPlayerScore[]; /** * Creates a new Scores instance using the specified properties. * @param [properties] Properties to set * @returns Scores instance */ public static create(properties?: IScores): Scores; /** * Encodes the specified Scores message. Does not implicitly {@link Scores.verify|verify} messages. * @param message Scores message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ public static encode(message: IScores, writer?: $protobuf.Writer): $protobuf.Writer; /** * Encodes the specified Scores message, length delimited. Does not implicitly {@link Scores.verify|verify} messages. * @param message Scores message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ public static encodeDelimited(message: IScores, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes a Scores message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand * @returns Scores * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Scores; /** * Decodes a Scores message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from * @returns Scores * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Scores; /** * Verifies a Scores message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** * Creates a Scores message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns Scores */ public static fromObject(object: { [k: string]: any }): Scores; /** * Creates a plain object from a Scores message. Also converts values to other types if specified. * @param message Scores * @param [options] Conversion options * @returns Plain object */ public static toObject(message: Scores, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this Scores to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } /** Represents a HighScores. */ export class HighScores implements IHighScores { /** * Constructs a new HighScores. * @param [properties] Properties to set */ constructor(properties?: IHighScores); /** HighScores highScores. */ public highScores: number[]; /** * Creates a new HighScores instance using the specified properties. * @param [properties] Properties to set * @returns HighScores instance */ public static create(properties?: IHighScores): HighScores; /** * Encodes the specified HighScores message. Does not implicitly {@link HighScores.verify|verify} messages. * @param message HighScores message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ public static encode(message: IHighScores, writer?: $protobuf.Writer): $protobuf.Writer; /** * Encodes the specified HighScores message, length delimited. Does not implicitly {@link HighScores.verify|verify} messages. * @param message HighScores message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ public static encodeDelimited(message: IHighScores, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes a HighScores message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand * @returns HighScores * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): HighScores; /** * Decodes a HighScores message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from * @returns HighScores * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): HighScores; /** * Verifies a HighScores message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** * Creates a HighScores message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns HighScores */ public static fromObject(object: { [k: string]: any }): HighScores; /** * Creates a plain object from a HighScores message. Also converts values to other types if specified. * @param message HighScores * @param [options] Conversion options * @returns Plain object */ public static toObject(message: HighScores, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this HighScores to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } ```Intermediate JavaScript file on Windows
```js /*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ "use strict"; var $protobuf = require("protobufjs/minimal"); // Common aliases var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); /** * PlayerColor enum. * @exports PlayerColor * @enum {string} * @property {number} RED=0 RED value * @property {number} BLUE=1 BLUE value * @property {number} GREEN=2 GREEN value * @property {number} YELLOW=3 YELLOW value * @property {number} PURPLE=4 PURPLE value */ $root.PlayerColor = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "RED"] = 0; values[valuesById[1] = "BLUE"] = 1; values[valuesById[2] = "GREEN"] = 2; values[valuesById[3] = "YELLOW"] = 3; values[valuesById[4] = "PURPLE"] = 4; return values; })(); $root.PlayerScore = (function() { /** * Properties of a PlayerScore. * @exports IPlayerScore * @interface IPlayerScore * @property {PlayerColor|null} [player] PlayerScore player * @property {number|null} [score] PlayerScore score */ /** * Constructs a new PlayerScore. * @exports PlayerScore * @classdesc Represents a PlayerScore. * @implements IPlayerScore * @constructor * @param {IPlayerScore=} [properties] Properties to set */ function PlayerScore(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** * PlayerScore player. * @member {PlayerColor} player * @memberof PlayerScore * @instance */ PlayerScore.prototype.player = 0; /** * PlayerScore score. * @member {number} score * @memberof PlayerScore * @instance */ PlayerScore.prototype.score = 0; /** * Creates a new PlayerScore instance using the specified properties. * @function create * @memberof PlayerScore * @static * @param {IPlayerScore=} [properties] Properties to set * @returns {PlayerScore} PlayerScore instance */ PlayerScore.create = function create(properties) { return new PlayerScore(properties); }; /** * Encodes the specified PlayerScore message. Does not implicitly {@link PlayerScore.verify|verify} messages. * @function encode * @memberof PlayerScore * @static * @param {IPlayerScore} message PlayerScore message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ PlayerScore.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.player != null && message.hasOwnProperty("player")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.player); if (message.score != null && message.hasOwnProperty("score")) writer.uint32(/* id 2, wireType 0 =*/16).sint32(message.score); return writer; }; /** * Encodes the specified PlayerScore message, length delimited. Does not implicitly {@link PlayerScore.verify|verify} messages. * @function encodeDelimited * @memberof PlayerScore * @static * @param {IPlayerScore} message PlayerScore message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ PlayerScore.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a PlayerScore message from the specified reader or buffer. * @function decode * @memberof PlayerScore * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {PlayerScore} PlayerScore * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ PlayerScore.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.PlayerScore(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.player = reader.int32(); break; case 2: message.score = reader.sint32(); break; default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a PlayerScore message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof PlayerScore * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {PlayerScore} PlayerScore * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ PlayerScore.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a PlayerScore message. * @function verify * @memberof PlayerScore * @static * @param {Object.Resulting TypeScript on Windows
```ts import * as $protobuf from "protobufjs"; /** PlayerColor enum. */ export enum PlayerColor { RED = 0, BLUE = 1, GREEN = 2, YELLOW = 3, PURPLE = 4 } /** Properties of a PlayerScore. */ export interface IPlayerScore { /** PlayerScore player */ player?: (PlayerColor|null); /** PlayerScore score */ score?: (number|null); } /** Represents a PlayerScore. */ export class PlayerScore implements IPlayerScore { /** * Constructs a new PlayerScore. * @param [properties] Properties to set */ constructor(properties?: IPlayerScore); /** PlayerScore player. */ public player: PlayerColor; /** PlayerScore score. */ public score: number; /** * Creates a new PlayerScore instance using the specified properties. * @param [properties] Properties to set * @returns PlayerScore instance */ public static create(properties?: IPlayerScore): PlayerScore; /** * Encodes the specified PlayerScore message. Does not implicitly {@link PlayerScore.verify|verify} messages. * @param message PlayerScore message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ public static encode(message: IPlayerScore, writer?: $protobuf.Writer): $protobuf.Writer; /** * Encodes the specified PlayerScore message, length delimited. Does not implicitly {@link PlayerScore.verify|verify} messages. * @param message PlayerScore message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ public static encodeDelimited(message: IPlayerScore, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes a PlayerScore message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand * @returns PlayerScore * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): PlayerScore; /** * Decodes a PlayerScore message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from * @returns PlayerScore * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): PlayerScore; /** * Verifies a PlayerScore message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** * Creates a PlayerScore message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns PlayerScore */ public static fromObject(object: { [k: string]: any }): PlayerScore; /** * Creates a plain object from a PlayerScore message. Also converts values to other types if specified. * @param message PlayerScore * @param [options] Conversion options * @returns Plain object */ public static toObject(message: PlayerScore, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this PlayerScore to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } /** Properties of a Scores. */ export interface IScores { /** Scores scores */ scores?: (IPlayerScore[]|null); } /** Represents a Scores. */ export class Scores implements IScores { /** * Constructs a new Scores. * @param [properties] Properties to set */ constructor(properties?: IScores); /** Scores scores. */ public scores: IPlayerScore[]; /** * Creates a new Scores instance using the specified properties. * @param [properties] Properties to set * @returns Scores instance */ public static create(properties?: IScores): Scores; /** * Encodes the specified Scores message. Does not implicitly {@link Scores.verify|verify} messages. * @param message Scores message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ public static encode(message: IScores, writer?: $protobuf.Writer): $protobuf.Writer; /** * Encodes the specified Scores message, length delimited. Does not implicitly {@link Scores.verify|verify} messages. * @param message Scores message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ public static encodeDelimited(message: IScores, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes a Scores message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand * @returns Scores * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Scores; /** * Decodes a Scores message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from * @returns Scores * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Scores; /** * Verifies a Scores message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** * Creates a Scores message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns Scores */ public static fromObject(object: { [k: string]: any }): Scores; /** * Creates a plain object from a Scores message. Also converts values to other types if specified. * @param message Scores * @param [options] Conversion options * @returns Plain object */ public static toObject(message: Scores, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this Scores to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } /** Properties of a HighScores. */ export interface IHighScores { /** HighScores highScores */ highScores?: (number[]|null); } /** Represents a HighScores. */ export class HighScores implements IHighScores { /** * Constructs a new HighScores. * @param [properties] Properties to set */ constructor(properties?: IHighScores); /** HighScores highScores. */ public highScores: number[]; /** * Creates a new HighScores instance using the specified properties. * @param [properties] Properties to set * @returns HighScores instance */ public static create(properties?: IHighScores): HighScores; /** * Encodes the specified HighScores message. Does not implicitly {@link HighScores.verify|verify} messages. * @param message HighScores message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ public static encode(message: IHighScores, writer?: $protobuf.Writer): $protobuf.Writer; /** * Encodes the specified HighScores message, length delimited. Does not implicitly {@link HighScores.verify|verify} messages. * @param message HighScores message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ public static encodeDelimited(message: IHighScores, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes a HighScores message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand * @returns HighScores * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): HighScores; /** * Decodes a HighScores message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from * @returns HighScores * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): HighScores; /** * Verifies a HighScores message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** * Creates a HighScores message from a plain object. Also converts values to their respective internal types. * @param object Plain object * @returns HighScores */ public static fromObject(object: { [k: string]: any }): HighScores; /** * Creates a plain object from a HighScores message. Also converts values to other types if specified. * @param message HighScores * @param [options] Conversion options * @returns Plain object */ public static toObject(message: HighScores, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this HighScores to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } ```Finally, when we go to build the whole project (with some other proto files that aren't included) we get the following stack trace.
Stack Trace
``` $ yarn build --prod yarn run v1.12.3 $ ng build --prod Date: 2019-05-14T20:22:15.277Z Hash: 793dc4cf2c64f07a592f Time: 13801ms chunk {0} runtime.26209474bfa8dc87a77c.js (runtime) 1.41 kB [entry] [rendered] chunk {1} es2015-polyfills.1e04665e16f944715fd2.js (es2015-polyfills) 56.4 kB [initial] [rendered] chunk {2} main.fa4681da67b0e16d34dc.js (main) 128 bytes [initial] [rendered] chunk {3} polyfills.41559ea504b9f00b6dea.js (polyfills) 130 bytes [initial] [rendered] chunk {4} styles.0fe1b01975df52cb54b0.css (styles) 150 kB [initial] [rendered] ERROR in src/app/models/ProtocolBufferMessages.d.ts(21,19): error TS2304: Cannot find name 'IHighScores'. src/app/models/ProtocolBufferMessages.d.ts(49,26): error TS2304: Cannot find name 'IHighScores'. src/app/models/ProtocolBufferMessages.d.ts(129,15): error TS2709: Cannot use namespace 'PlayerColor' as a type. src/app/models/ProtocolBufferMessages.d.ts(132,20): error TS2304: Cannot find name 'IScores'. src/app/models/ProtocolBufferMessages.d.ts(135,19): error TS2304: Cannot find name 'IHighScores'. src/app/models/ProtocolBufferMessages.d.ts(151,20): error TS2709: Cannot use namespace 'PlayerColor' as a type. src/app/models/ProtocolBufferMessages.d.ts(154,27): error TS2304: Cannot find name 'IScores'. src/app/models/ProtocolBufferMessages.d.ts(157,26): error TS2304: Cannot find name 'IHighScores'. src/app/models/ProtocolBufferMessages.d.ts(355,1): error TS1046: A 'declare' modifier is required for a top level declaration in a .d.ts file. src/app/models/ProtocolBufferMessages.d.ts(374,37): error TS2304: Cannot find name 'IPlayerScore'. src/app/models/ProtocolBufferMessages.d.ts(380,30): error TS2304: Cannot find name 'IPlayerScore'. src/app/models/ProtocolBufferMessages.d.ts(383,20): error TS2709: Cannot use namespace 'PlayerColor' as a type. src/app/models/ProtocolBufferMessages.d.ts(393,39): error TS2304: Cannot find name 'IPlayerScore'. src/app/models/ProtocolBufferMessages.d.ts(401,35): error TS2304: Cannot find name 'IPlayerScore'. src/app/models/ProtocolBufferMessages.d.ts(409,44): error TS2304: Cannot find name 'IPlayerScore'. src/app/models/ProtocolBufferMessages.d.ts(460,32): error TS2304: Cannot find name 'IScores'. src/app/models/ProtocolBufferMessages.d.ts(466,30): error TS2304: Cannot find name 'IScores'. src/app/models/ProtocolBufferMessages.d.ts(469,20): error TS2304: Cannot find name 'IPlayerScore'. src/app/models/ProtocolBufferMessages.d.ts(476,39): error TS2304: Cannot find name 'IScores'. src/app/models/ProtocolBufferMessages.d.ts(484,35): error TS2304: Cannot find name 'IScores'. src/app/models/ProtocolBufferMessages.d.ts(492,44): error TS2304: Cannot find name 'IScores'. src/app/models/ProtocolBufferMessages.d.ts(543,36): error TS2304: Cannot find name 'IHighScores'. src/app/models/ProtocolBufferMessages.d.ts(549,30): error TS2304: Cannot find name 'IHighScores'. src/app/models/ProtocolBufferMessages.d.ts(559,39): error TS2304: Cannot find name 'IHighScores'. src/app/models/ProtocolBufferMessages.d.ts(567,35): error TS2304: Cannot find name 'IHighScores'. src/app/models/ProtocolBufferMessages.d.ts(575,44): error TS2304: Cannot find name 'IHighScores'. src/app/models/ProtocolBufferMessages.d.ts(626,36): error TS2304: Cannot find name 'ITransition'. src/app/models/ProtocolBufferMessages.d.ts(632,30): error TS2304: Cannot find name 'ITransition'. src/app/models/ProtocolBufferMessages.d.ts(645,39): error TS2304: Cannot find name 'ITransition'. src/app/models/ProtocolBufferMessages.d.ts(653,35): error TS2304: Cannot find name 'ITransition'. src/app/models/ProtocolBufferMessages.d.ts(661,44): error TS2304: Cannot find name 'ITransition'. src/app/models/ProtocolBufferMessages.d.ts(721,39): error TS2304: Cannot find name 'IReadyResponse'. src/app/models/ProtocolBufferMessages.d.ts(727,30): error TS2304: Cannot find name 'IReadyResponse'. src/app/models/ProtocolBufferMessages.d.ts(740,39): error TS2304: Cannot find name 'IReadyResponse'. src/app/models/ProtocolBufferMessages.d.ts(748,35): error TS2304: Cannot find name 'IReadyResponse'. src/app/models/ProtocolBufferMessages.d.ts(756,44): error TS2304: Cannot find name 'IReadyResponse'. src/app/services/translations/translations.service.ts(42,29): error TS2709: Cannot use namespace 'PlayerColor' as a type. src/app/services/translations/translations.service.ts(65,35): error TS2709: Cannot use namespace 'PlayerColor' as a type. src/app/services/scores/scores.service.ts(5,43): error TS2724: Module '"../../models/ProtocolBufferMessages"' has no exported member 'IPlayerScore'. Did you mean 'PlayerScore'? src/app/services/scores/scores.service.ts(97,23): error TS2709: Cannot use namespace 'PlayerColor' as a type. src/app/services/scores/scores.service.ts(98,27): error TS2709: Cannot use namespace 'PlayerColor' as a type. ```