Skip to content

fix(amplify-category-function): pin jstreemap to 1.28.2 (self is not …#14922

Open
adrianjoshua-strutt wants to merge 1 commit into
devfrom
fix/pin-jstreemap-self-not-defined
Open

fix(amplify-category-function): pin jstreemap to 1.28.2 (self is not …#14922
adrianjoshua-strutt wants to merge 1 commit into
devfrom
fix/pin-jstreemap-self-not-defined

Conversation

@adrianjoshua-strutt

@adrianjoshua-strutt adrianjoshua-strutt commented Jun 21, 2026

Copy link
Copy Markdown
Member

jstreemap 1.29.1/1.29.2/1.29.3 (published 2026-06-19) ships a broken UMD bundle that references bare self — undefined in Node.js — causing a ReferenceError at require('jstreemap') time. This crashes amplify-category- function during amplify init on every Node version (18 and 22 confirmed).

Root cause: jstreemap changed their UMD guard from the safe pattern
typeof self !== 'undefined' ? self : this
to bare self, which is only defined in browser/ServiceWorker contexts.

Impact: Every amplify init that loads the function category throws
ReferenceError: self is not defined
making the Gen1 CLI completely unusable for function workflows. Canary SEV-2s: P457496122 / P457522624 / P457523805 Timeline: jstreemap 1.29.1 published 15:44 UTC June 19; canaries red by 16:00 UTC.

Fix:

  • Pin jstreemap to 1.28.2 (last known-good version) in packages/amplify-category-function/package.json
  • Add root-level yarn resolutions entry to force 1.28.2 everywhere transitively, preventing any future accidental upgrade
  • Update yarn.lock to reflect exact-version key alongside caret key

The upstream jstreemap package should guard self with typeof before accessing it; a separate upstream issue should be filed.

Description of changes

Issue #, if available

Description of how you validated changes

Checklist

  • PR description included
  • yarn test passes
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)
  • New AWS SDK calls or CloudFormation actions have been added to relevant test and service IAM policies
  • Pull request labels are added

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@adrianjoshua-strutt adrianjoshua-strutt requested a review from a team as a code owner June 21, 2026 11:44
Simone319
Simone319 previously approved these changes Jun 22, 2026
sarayev
sarayev previously approved these changes Jun 22, 2026
@adrianjoshua-strutt adrianjoshua-strutt dismissed stale reviews from sarayev and Simone319 via 02986af June 22, 2026 14:59
@adrianjoshua-strutt adrianjoshua-strutt force-pushed the fix/pin-jstreemap-self-not-defined branch from c0c700c to 02986af Compare June 22, 2026 14:59
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.

3 participants