Skip to content

pbts generates invalid typescript when used on Windows #1275

@oceanusxiv

Description

@oceanusxiv

protobuf.js version: 6.8.8

When on Windows, pbts generates invalid typescript even though pbjs is outputting the correct annotated js file.

Using the test proto from the protobufjs repo here.

The expected typescript file would contain

public static verify(message: { [k: string]: any }): (string|null);

as seen here.

Instead the type file contains

public static verify(message: [ 'object' ].<string, any>): (string|null);

which is invalid typescript code.

The commands I ran for the conversion were

yarn run pbjs -t static-module -w commonjs -o protobufjs/comments.js protos/comments.proto
yarn run pbts -o protobufjs/comments.d.ts protobufjs/comments.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions