beam icon indicating copy to clipboard operation
beam copied to clipboard

[Bug]: beam-starter-typescript: npm run build: TypeError: Cannot set property constructor of [object Object] which has only a getter

Open denis-haskin-elemental opened this issue 11 months ago • 4 comments

What happened?

Follow the steps in the README: https://github.com/apache/beam-starter-typescript?tab=readme-ov-file

Clone the repository, then:

✗ npm install

up to date in 402ms

27 packages are looking for funding
  run `npm fund` for details
✗ npm run build

> [email protected] build
> ttsc

/Users/denis/em/beam-starter-typescript/node_modules/ttypescript/lib/loadTypescript.js:13
        function __() { this.constructor = d; }
                                         ^

TypeError: Cannot set property constructor of [object Object] which has only a getter
    at new __ (/Users/denis/em/beam-starter-typescript/node_modules/ttypescript/lib/loadTypescript.js:13:42)
    at __extends (/Users/denis/em/beam-starter-typescript/node_modules/ttypescript/lib/loadTypescript.js:14:84)
    at /Users/denis/em/beam-starter-typescript/node_modules/ttypescript/lib/loadTypescript.js:65:5
    at Object.<anonymous> (/Users/denis/em/beam-starter-typescript/node_modules/ttypescript/lib/loadTypescript.js:100:2)
    at Module._compile (node:internal/modules/cjs/loader:1358:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
    at Module._load (node:internal/modules/cjs/loader:1024:12)
    at Module.require (node:internal/modules/cjs/loader:1233:19)
    at require (node:internal/modules/helpers:179:18)

Node.js v20.15.0

Is there perhaps a nodejs version constraint which is not specified in the package.json?

Is that project still valid?


(Also, the apache/beam-starter-typescript Github project does not have issues enabled, so I assume this should get eported here)

Issue Priority

Priority: 2 (default / most bugs should be filed as P2)

Issue Components

  • [ ] Component: Python SDK
  • [ ] Component: Java SDK
  • [ ] Component: Go SDK
  • [X] Component: Typescript SDK
  • [ ] Component: IO connector
  • [ ] Component: Beam YAML
  • [X] Component: Beam examples
  • [ ] Component: Beam playground
  • [ ] Component: Beam katas
  • [ ] Component: Website
  • [ ] Component: Infrastructure
  • [ ] Component: Spark Runner
  • [ ] Component: Flink Runner
  • [ ] Component: Samza Runner
  • [ ] Component: Twister2 Runner
  • [ ] Component: Hazelcast Jet Runner
  • [ ] Component: Google Cloud Dataflow Runner

denis-haskin-elemental avatar Jan 07 '25 21:01 denis-haskin-elemental

fwiw, I tried with nodejs 18 and 16 with the same result.

denis-haskin-elemental avatar Jan 07 '25 21:01 denis-haskin-elemental

Also, fwiw, I was able to set up blank nodejs tyepscript project, install apache-beam, and run trivial examples (nodejs 20.15.0). So it seems there's just something with the setup of this starter project.

denis-haskin-elemental avatar Jan 08 '25 14:01 denis-haskin-elemental

beam-starter-typescript is using ttypescript that is deprecated in Github but not in npm so seems effectively dead.

tkurki avatar Jan 10 '25 18:01 tkurki

This issue has been marked as stale due to 150 days of inactivity. It will be closed in 30 days if no further activity occurs. If you think that’s incorrect or this issue still needs to be addressed, please simply write any comment. If closed, you can reopen the issue at any time. Thank you for your contributions.

github-actions[bot] avatar Jun 11 '25 12:06 github-actions[bot]

This issue has been closed due to lack of activity. If you think that is incorrect, you can reopen the issue at any time.

github-actions[bot] avatar Jul 11 '25 12:07 github-actions[bot]