My Node.JS project uses --moduleResolution=nodenext
. Code generation script:
"proto": "npx grpc_tools_node_protoc --js_out=import_style=commonjs,binary:./grpc/client --grpc_out=grpc_js:./grpc/client --plugin=protoc-gen-grpc=`which grpc_tools_node_protoc_plugin` -I ./grpc/proto ./grpc/proto/*.proto && npx protoc --plugin=protoc-gen-ts=`which protoc-gen-ts` --ts_out=grpc_js:./grpc/client -I ./grpc/proto ./grpc/proto/*.proto",
Build errors:
grpc/client/response.ts:93:12 - error TS4114: This member must have an 'override' modifier because it overrides a member in the base class 'Message'.
93 static deserializeBinary(bytes: Uint8Array): Response {
~~~~~~~~~~~~~~~~~
grpc/client/response.ts:183:12 - error TS4114: This member must have an 'override' modifier because it overrides a member in the base class 'Message'.
183 static deserializeBinary(bytes: Uint8Array): Error {
~~~~~~~~~~~~~~~~~
grpc/client/school.ts:6:31 - error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './student.js'?
6 import * as dependency_1 from "./student";
~~~~~~~~~~~
grpc/client/school.ts:7:31 - error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './teacher.js'?
7 import * as dependency_2 from "./teacher";
~~~~~~~~~~~
grpc/client/school.ts:8:31 - error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './response.js'?
8 import * as dependency_3 from "./response";
~~~~~~~~~~~~
grpc/client/school.ts:98:16 - error TS4114: This member must have an 'override' modifier because it overrides a member in the base class 'Message'.
98 static deserializeBinary(bytes: Uint8Array): RegisterRequest {
~~~~~~~~~~~~~~~~~
grpc/client/school.ts:191:16 - error TS4114: This member must have an 'override' modifier because it overrides a member in the base class 'Message'.
191 static deserializeBinary(bytes: Uint8Array): AddStudentsToTeacherRequest {
~~~~~~~~~~~~~~~~~
grpc/client/student.ts:163:16 - error TS4114: This member must have an 'override' modifier because it overrides a member in the base class 'Message'.
163 static deserializeBinary(bytes: Uint8Array): student {
~~~~~~~~~~~~~~~~~
grpc/client/teacher.ts:140:16 - error TS4114: This member must have an 'override' modifier because it overrides a member in the base class 'Message'.
140 static deserializeBinary(bytes: Uint8Array): teacher {
~~~~~~~~~~~~~~~~~
Found 9 errors in 4 files.
Errors Files
2 grpc/client/response.ts:93
5 grpc/client/school.ts:6
1 grpc/client/student.ts:163
1 grpc/client/teacher.ts:140
npm error Lifecycle script `build` failed with error:
npm error code 1
npm error path /usr/src/Node.JSRestAPI/src/webapi
npm error workspace [email protected]
npm error location /usr/src/Node.JSRestAPI/src/webapi
npm error command failed
npm error command sh -c tsc --project tsconfig.json && npm run rollup
ERROR: "build_webapi" exited with 1.