Skip to content

fix: make esbuild available at runtime - #2126

Open
Ryuta1005 wants to merge 1 commit into
aws:mainfrom
Ryuta1005:fix/esbuild-runtime-dependency
Open

fix: make esbuild available at runtime#2126
Ryuta1005 wants to merge 1 commit into
aws:mainfrom
Ryuta1005:fix/esbuild-runtime-dependency

Conversation

@Ryuta1005

Copy link
Copy Markdown

Description

TypeScript CodeZip packaging invokes esbuild at runtime. However, the CLI build bundles esbuild's JavaScript API, causing agentcore package to fail with:

The esbuild JavaScript API cannot be bundled.
Please mark the "esbuild" package as external so it's not included in the bundle.

This PR:

  • Adds esbuild to the CLI build's external list.
  • Moves esbuild from devDependencies to dependencies and updates npm-shrinkwrap.json without changing the version range.
  • Adds a minimal TypeScript packaging fixture.
  • Extends the existing installed-tarball smoke test to package the fixture and verify that TestRuntime.zip is generated.

Both dependency changes are necessary: externalizing esbuild prevents it from being bundled into the CLI, while declaring it as a production dependency makes it available after installation.

The existing global tarball installation step is unchanged. The fixture has no application dependencies and exists only to exercise TypeScript packaging.

Related Issue

Closes #2125

Documentation PR

N/A — this fixes package distribution without changing the public CLI interface.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Testing

Validation was performed on macOS with Node.js v24.15.0.

  • npm run test:unit — 428 test files passed; 6,150 tests passed.
  • npm run test:integ — 34 test files passed; 342 tests passed and 1 test skipped.
  • npm run typecheck — passed.
  • npm run lint — completed with 0 errors and 32 warnings.
  • If I modified src/assets/, I ran npm run test:update-snapshots and committed the updated snapshots — N/A; no files under src/assets/ were modified.

All reported lint warnings are in files not modified by this PR. No additional lint warnings were observed compared with main.

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly — N/A; no documentation changes are needed
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published — N/A; there are no dependent changes

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@Ryuta1005
Ryuta1005 requested a review from a team August 27, 2026 16:44
@github-actions github-actions Bot added the size/s PR size: S label Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: agentcore package fails for TypeScript because esbuild is bundled

1 participant