bug: agentcore package fails for TypeScript because esbuild is bundled
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ả
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
- Use an unmodified npm installation of
@aws/[email protected]. - 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
}
- 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
esbuildas external in the CLI build. - Moves
esbuildfromdevDependenciestodependencies, retaining the existing version range and updatingnpm-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
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của aws/agentcore-cli
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
aws/agentcore-cli#2395 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
aws/agentcore-cli#2392 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
aws/agentcore-cli#2267 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
aws/agentcore-cli#2258 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
aws/agentcore-cli#2176 ·
Tất cả issue của aws/agentcore-cli
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
-
security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
IBM/node-sdk-core#373 ·
-
e2e-failure ready-to-code
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
-
chore
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100