Andrushika opened a new pull request, #75067:
URL: https://github.com/apache/airflow/pull/75067
## Why
`airflow-ts-pack` bundles a TypeScript Dag into one ESM file with esbuild,
then runs that file once to read its Dags. When a dependency ships CommonJS for
Node, esbuild turns its `require("fs")` into a shim that throws if no `require`
is in scope, and an ESM file has none. So pack fails with `Dynamic require of
"fs" is not supported` for any Dag that imports such a package. On main, 9 of
the 15 common packages I tried fail this way, including `yaml`, `pg`, `axios`,
`@aws-sdk/client-s3` and `dotenv`. Users cannot pass esbuild options to
`airflow-ts-pack`, so they cannot work around it.
## What
Add an esbuild banner that defines `require` with
`createRequire(import.meta.url)`, the usual workaround from
https://github.com/evanw/esbuild/issues/1921. With it, all 15 packages pack and
run.
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes — Claude Code (Opus 5.5)
Generated-by: Claude Code (Opus 5.5) following [the
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]