Skip to content

fix(ci): replace top-level await with async IIFE in CI runner#61

Merged
MagPasulke merged 2 commits into
mainfrom
fix/deploy-sap-esm-flag
May 30, 2026
Merged

fix(ci): replace top-level await with async IIFE in CI runner#61
MagPasulke merged 2 commits into
mainfrom
fix/deploy-sap-esm-flag

Conversation

@MagPasulke
Copy link
Copy Markdown
Owner

Fix

Second attempt at fixing the deploy-sap workflow failure.

Root cause: tsx defaults to CJS output, which does not support top-level await. The previous fix attempted --esm as a tsx flag, but that is actually a Node.js flag — tsx rejected it with bad option: --esm.

Fix: Wrap the async logic in a void (async () => { ... })() IIFE. This works regardless of output format and requires no flags.

tsx defaults to CJS output which does not support top-level await.
Wrapping the async logic in an IIFE avoids the need for ESM output
and works with any tsx version without extra flags.

Also reverts the --esm flag from the workflow (not a valid tsx flag).
@MagPasulke MagPasulke merged commit b8995c5 into main May 30, 2026
1 check passed
@MagPasulke MagPasulke deleted the fix/deploy-sap-esm-flag branch May 30, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant