question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Typescript 4.8.2 support

See original GitHub issue

Typescript version 4.8.2 just got released. There is deprecated function used in the plugin.

Functions: createParameterDeclaration

Error:

TypeError: Invalid arguments
    at Object.createParameterDeclaration (/usr/local/lib/node_modules/@domain/protoc-gen-ts/node_modules/typescript/lib/typescript.js:170461:19)
    at createParameter (/usr/local/lib/node_modules/@domain/protoc-gen-ts/src/rpc.js:154:23)
    at Object.createGrpcInterfaceType (/usr/local/lib/node_modules/@domain/protoc-gen-ts/src/rpc.js:161:31)
    at Object.<anonymous> (/usr/local/lib/node_modules/@domain/protoc-gen-ts/src/index.js:54:32)
    at Module._compile (node:internal/modules/cjs/loader:1126:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
    at Module.load (node:internal/modules/cjs/loader:1004:32)
    at Function.Module._load (node:internal/modules/cjs/loader:839:12)
    at Module.require (node:internal/modules/cjs/loader:1028:19)
    at require (node:internal/modules/cjs/helpers:102:18)
--ts_out: protoc-gen-ts: Plugin failed with status code 1.

According the line 170461 in typescript package it seems like the function was removed completly.

// Deprecations fall into one of three categories:
//
// - "soft" - Soft deprecations are indicated with the `@deprecated` JSDoc Tag.
// - "warn" - Warning deprecations are indicated with the `@deprecated` JSDoc Tag and a diagnostic message (assuming a compatible host).
// - "error" - Error deprecations are either indicated with the `@deprecated` JSDoc tag and will throw a `TypeError` when invoked, or removed from the API entirely.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:4
  • Comments:16 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
btcStevencommented, Oct 13, 2022
image I solve it ; in your node_modules protoc-gen-ts -> package.json typescript remove ^ use old version
2reactions
stannedelchevcommented, Sep 21, 2022

@thesayyn This is happening on my end too with the latest TypeScript 4.8.3. Installed protoc-gen-ts with npm -g install protoc-gen-ts and then ran protoc -I=. hello.proto --ts_out=. Error call stack is same as post above. Other protobuf compilers (Go, JS) work fine on the same .proto file.

hello.proto:

syntax = "proto3";

service HelloWorld {
    rpc SayHello (HelloRequest) returns (HelloResponse) {}
}

message HelloRequest {
    string Name = 1;
}

message HelloResponse {
    string Message = 1;
}

Error call stack is the same as previous post:

/usr/lib/node_modules/protoc-gen-ts/node_modules/typescript/lib/typescript.js:170487
            throw new TypeError("Invalid arguments");
            ^

TypeError: Invalid arguments
    at Object.createParameterDeclaration (/usr/lib/node_modules/protoc-gen-ts/node_modules/typescript/lib/typescript.js:170487:19)
    at createParameter (/usr/lib/node_modules/protoc-gen-ts/src/rpc.js:154:23)
    at Object.createGrpcInterfaceType (/usr/lib/node_modules/protoc-gen-ts/src/rpc.js:161:31)
    at Object.<anonymous> (/usr/lib/node_modules/protoc-gen-ts/src/index.js:55:32)
    at Module._compile (node:internal/modules/cjs/loader:1119:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1173:10)
    at Module.load (node:internal/modules/cjs/loader:997:32)
    at Module._load (node:internal/modules/cjs/loader:838:12)
    at Module.require (node:internal/modules/cjs/loader:1021:19)
    at require (node:internal/modules/cjs/helpers:103:18)

Node.js v18.9.0
--ts_out: protoc-gen-ts: Plugin failed with status code 1.
Read more comments on GitHub >

github_iconTop Results From Across the Web

typescript - npm
4.8.2 • Public • Published 20 days ago ... TypeScript adds optional types to JavaScript that support tools for large-scale JavaScript ...
Read more >
Documentation - TypeScript 4.8
To support both legacy decorators and decorators as proposed, TypeScript will have to gracefully parse, and intersperse, modifiers and decorators. To do this, ......
Read more >
TypeScript 4.8 Support · Issue #5227 - GitHub
Unconstrained Generics No Longer Assignable to {}; Types Cannot Be Imported/Exported in JavaScript Files; Binding Patterns Do Not Directly Contribute to ...
Read more >
What's New in TypeScript 4.8 - Visual Studio Magazine
Microsoft released TypeScript 4.8 with a host of new features ranging from Find All References improvements to the ability to exclude ...
Read more >
The Definitive TypeScript 4.8 Guide - SitePen
Syntax and JavaScript support. TypeScript supports current JavaScript syntax (through ES2022), as well as a number of draft language proposals.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found