Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

bug: agentcore package fails for TypeScript because esbuild is bundled

Đang mở
#2,125 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
build-system, cli

Hướng nghiên cứu

Bắt đầu với esbuild.config.mjs và package manifest để theo dõi cách CLI bundle và cài đặt esbuild. Xem lại các thay đổi trong npm-shrinkwrap.json và mở rộng smoke test hiện có cho installed tarball bằng fixture TypeScript tối thiểu được mô tả ở đây. Hoàn tất khi một cài đặt npm-packed sạch chạy agentcore package và tạo ZIP mong đợi mà không gặp lỗi bundling.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug
Description

agentcore package fails when packaging a TypeScript CodeZip project because the CLI bundle includes esbuild's JavaScript API.

I encountered this with @aws/agentcore versions 0.27.1 and 0.28.0.

Steps to Reproduce
  1. Use an unmodified npm installation of @aws/[email protected].
  2. Create a minimal project with the following files.

agentcore/agentcore.json:

{
  "name": "PackageTest",
  "version": 1,
  "runtimes": [
    {
      "name": "TestRuntime",
      "build": "CodeZip",
      "entrypoint": "main.ts",
      "codeLocation": "./app/TestRuntime",
      "runtimeVersion": "NODE_22",
      "protocol": "HTTP"
    }
  ]
}

app/TestRuntime/main.ts:

export {};

app/TestRuntime/package.json:

{
  "name": "typescript-package-fixture",
  "version": "1.0.0",
  "private": true
}
  1. From the project root, run:
agentcore package
Expected Behavior

The command successfully bundles the TypeScript entry point and creates agentcore/TestRuntime.zip.

Actual Behavior

Packaging fails with:

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

0.28.0

Operating System

macOS

Additional Context

The original environment used Node.js v24.15.0.

In esbuild.config.mjs, esbuild is not listed as an external dependency, so its JavaScript API is bundled into the CLI. TypeScript CodeZip packaging invokes that API at runtime.

Marking esbuild as external alone is insufficient: it is currently a development dependency, so an npm installation of the published CLI does not install it as a direct runtime dependency.

I have prepared a patch that:

  • Marks esbuild as external in the CLI build.
  • Moves esbuild from devDependencies to dependencies, retaining the existing version range and updating npm-shrinkwrap.json.
  • Extends the existing installed-tarball smoke test to package a minimal TypeScript fixture and check that the ZIP is generated.

In a separate clean installation from an npm-packed tarball, the unpatched CLI failed with the error above, while the patched CLI successfully generated the ZIP.

This report concerns local packaging; no AWS deployment is required to reproduce it.

Ngôn ngữ chính
TypeScript
Star
291
Fork
96
Merge trung bình
20 giờ 50 phút
Pull request đã merge (30 ngày)
214

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của aws/agentcore-cli

Tất cả issue của aws/agentcore-cli

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.