Skip to content

[v3-4-test] Fix "Dynamic require" error for CommonJS packages in airflow-ts-pack (#75067) - #75603

Merged
jason810496 merged 1 commit into
v3-4-testfrom
backport-8b2ef80-v3-4-test
Oct 25, 2026
Merged

jason810496 merged 1 commit into
v3-4-testfrom
backport-8b2ef80-v3-4-test

Conversation

@github-actions

Copy link
Copy Markdown
Contributor
  • Fix airflow-ts-pack for CommonJS packages using Node built-ins

airflow-ts-pack outputs an ESM bundle, and an ESM file has no
require. esbuild turns a CommonJS dependency's require("fs") into
a shim that throws Dynamic require of "fs" is not supported unless a
require is in scope. So any Dag importing such a package (yaml, pg,
axios, @aws-sdk/client-s3, ...) failed to pack, and users cannot pass
esbuild options to work around it.

  • Move the require banner comment onto the esbuild option
    (cherry picked from commit 8b2ef80)

Co-authored-by: Andrew Chang 69671930+Andrushika@users.noreply.github.com

…low-ts-pack (#75067)

* Fix airflow-ts-pack for CommonJS packages using Node built-ins

airflow-ts-pack outputs an ESM bundle, and an ESM file has no
`require`. esbuild turns a CommonJS dependency's `require("fs")` into
a shim that throws `Dynamic require of "fs" is not supported` unless a
`require` is in scope. So any Dag importing such a package (yaml, pg,
axios, @aws-sdk/client-s3, ...) failed to pack, and users cannot pass
esbuild options to work around it.

* Move the require banner comment onto the esbuild option
(cherry picked from commit 8b2ef80)

Co-authored-by: Andrew Chang <69671930+Andrushika@users.noreply.github.com>
@jason810496
jason810496 marked this pull request as ready for review October 25, 2026 07:56
@jason810496
jason810496 enabled auto-merge (squash) October 25, 2026 07:56
@jason810496
jason810496 merged commit 214bee4 into v3-4-test Oct 25, 2026
119 of 132 checks passed
@jason810496
jason810496 deleted the backport-8b2ef80-v3-4-test branch October 25, 2026 08:33
@github-actions github-actions Bot added this to the Airflow 3.4.1 milestone Oct 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor Author

Hi maintainer, this PR was merged without a milestone set.
We've automatically set the milestone to Airflow 3.4.1 based on: bug fix merged to version branch
If this milestone is not correct, please update it to the appropriate milestone.

This comment was generated by Milestone Tag Assistant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants