Hi everyone,

I am very interested in apache beam and watched a video on youtube about
the typescript SDK and that you might need some community support. That's
why I am reaching out. I have a proven experience of 10 years in data
engineering and data analytics, as well as python and javascript/typescript
experience. I am interested to support from time to time. Is this still
relevant?

First of all I tested the starter project for typescript. Unfortunately, it
is broken. I'd like to fix it (
https://beam.apache.org/get-started/quickstart/typescript/). So far I have
some *findings* regarding the *beam-starter-typescript*:


   1. The long module is breaking the build:

   
node_modules/google-gax/node_modules/@grpc/grpc-js/node_modules/long/umd/index.d.ts:1:18
   - error TS1479: The current file is a CommonJS module whose imports will
   produce 'require' calls; however, the referenced file is an ECMAScript
   module and cannot be imported with 'require'. Consider writing a dynamic
   'import("../index.js")' call instead.

   1 import Long from "../index.js";

   To fix this you can either set skibLibCheck to true in tsconfig.json,
   which is rather a dirty one, or make sure that an already existing fix (
   
https://github.com/dcodeIO/long.js/pull/1https://github.com/dcodeIO/long.js/pull/124
24
   <https://github.com/dcodeIO/long.js/pull/124>) is implemented in all
   dependecies. Therefore, we can simply upgrade all dependecies.

   <https://github.com/dcodeIO/long.js/pull/124>
   2. After upgrading to typescript to a higher version then >5.0.0, e.g.
   version 5.5.4 the ttypescript module is breaking the build:

   $ npm run build

   > apache-beam-starter-project@0.1.0 build
   > ttsc


   
/home/webnuke/Desktop/Projects/beam-starter-typescript/node_modules/ttypescript/lib/patchCreateProgram.js:84
       tsm.createProgram = createProgram;
                         ^

   TypeError: Cannot set property createProgram of #<Object> which has only
   a getter
       at patchCreateProgram
   
(/home/webnuke/Desktop/Projects/beam-starter-typescript/node_modules/ttypescript/lib/patchCreateProgram.js:84:23)
       at loadTypeScript
   
(/home/webnuke/Desktop/Projects/beam-starter-typescript/node_modules/ttypescript/lib/loadTypescript.js:21:56)
       at Object.<anonymous>
   
(/home/webnuke/Desktop/Projects/beam-starter-typescript/node_modules/ttypescript/lib/tsc.js:8:46)
       at Module._compile (node:internal/modules/cjs/loader:1364:14)
       at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
       at Module.load (node:internal/modules/cjs/loader:1203:32)
       at Module._load (node:internal/modules/cjs/loader:1019:12)
       at Module.require (node:internal/modules/cjs/loader:1231:19)
       at require (node:internal/modules/helpers:177:18)
       at Object.<anonymous>
   
(/home/webnuke/Desktop/Projects/beam-starter-typescript/node_modules/ttypescript/bin/tsc:2:1)

   There is already a fix available. Thus, when we would move to
   ttypescript version 1.1.15 it should be fixed.
   https://github.com/nonara/ts-patch/issues/93#issuecomment-1500795063
   <https://github.com/nonara/ts-patch/issues/93#issuecomment-1500795063>
   I just checked the version on github. In version 2.60-Snapshot the
   ttypescript module is already on version 1.1.15. Could you just release a
   new npm package. Currently, the newest version on npm is 2.49. Afterwards
   we can adapt the apache-beam version in the starter project. I assume then
   the starter project would work again.

I am looking forward to hearing from you!

Best,
Robert

Reply via email to