Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

bug: agentcore package fails for TypeScript because esbuild is bundled

Aperta
#2,125 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
build-system, cli

Direzione di ricerca

Inizia da esbuild.config.mjs e dal manifest del pacchetto per tracciare il modo in cui la CLI raggruppa e installa esbuild. Esamina le modifiche a npm-shrinkwrap.json ed estendi lo smoke test esistente del tarball installato con il fixture TypeScript minimo descritto qui. Il lavoro è completato quando un’installazione npm-packed pulita esegue agentcore package e crea lo ZIP previsto senza l’errore di bundling.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
291
Fork
96
Merge medio
18h 34m
PR unite (30g)
202

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di aws/agentcore-cli

Tutte le issue di aws/agentcore-cli

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.