Jens Geyer created THRIFT-6317:
----------------------------------

             Summary: lib/ts: the browser test does not compile against the 
generated TypeScript declarations
                 Key: THRIFT-6317
                 URL: https://issues.apache.org/jira/browse/THRIFT-6317
             Project: Thrift
          Issue Type: Bug
          Components: TypeScript - Library
            Reporter: Jens Geyer


{{make -C lib/ts check}} runs {{npx grunt}}, whose {{shell:BuildTS}} task 
compiles
{{lib/ts/test}} with the pinned TypeScript. On master that compile fails:

{code}
test.ts(58,34): error TS2345: Argument of type 'string' is not assignable to 
parameter of type 'Buffer<ArrayBufferLike>'.
test.ts(72,34): error TS2345: Argument of type 'string' is not assignable to 
parameter of type 'Buffer<ArrayBufferLike>'.
{code}

Both lines call {{client.testBinary()}} with a {{string}}, while the 
declaration generated from
{{test/v0.16/ThriftTest.thrift}} by {{thrift -gen js:ts}} takes a {{Buffer}}.

Reproduced on master {{6b1d360e7}} with Node 22.23.2 and the versions the 
lockfile pins
(typescript 5.7.3, @types/node 22.10.5), compiler built from the same tree.

Which side is wrong is open: either the test should hand over a {{Buffer}}, or 
the generator
should accept a string for a {{binary}} field. Worth checking when {{js:ts}} 
started emitting
{{Buffer}} here before picking one.

This is the first of two blockers in front of the lib/ts browser test; the 
second is the
browserify/uuid parse error. Neither is caused by
[PR #3747|https://github.com/apache/thrift/pull/3747] -- both reproduce 
identically on master.

Drafted with AI assistance (Claude Opus 5).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to