Skip to content

fix(@aws-amplify/core): bump tslib to ^2.1.0 to guarantee __spreadArray at runtime - #14884

Open
dikshit-n wants to merge 4 commits into
aws-amplify:v5-stablefrom
dikshit-n:fix/tslib-spreadarray-core
Open

fix(@aws-amplify/core): bump tslib to ^2.1.0 to guarantee __spreadArray at runtime#14884
dikshit-n wants to merge 4 commits into
aws-amplify:v5-stablefrom
dikshit-n:fix/tslib-spreadarray-core

Conversation

@dikshit-n

Copy link
Copy Markdown

Summary

Bump @aws-amplify/core v5 runtime tslib dependency from ^1.8.0 to ^2.1.0 so the emitted __spreadArray helper is guaranteed to exist at runtime.

Problem

@aws-amplify/core@5.8.18 compiles with importHelpers: true + target: es5, emitting calls to tslib.__spreadArray. However, ^1.8.0 resolves only to tslib@1.x (max 1.14.1), which does not export __spreadArray — it was added in tslib@2.1.0. Under certain dependency-tree conditions (e.g. a peer pulling tslib@1.x), this causes __spreadArray is not a function at runtime.

This is the same class of bug fixed for @aws-amplify/datastore in #14878.

Solution

Bump dependencies.tslib from ^1.8.0 to ^2.1.0 in packages/core/package.json. This mirrors the datastore fix and guarantees the __spreadArray helper is available when core's lib is consumed.

Changes Made

  • packages/core/package.json: tslib dependency range ^1.8.0^2.1.0

Testing

  • No code changes — dependency version bump only.
  • npm ls tslib in @aws-amplify/core workspace confirms ^2.1.0 resolves correctly.

Checklist

Closes #14879

@dikshit-n
dikshit-n requested review from a team as code owners July 20, 2026 04:58
@changeset-bot

changeset-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 3e2154d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@bobbor

bobbor commented Jul 22, 2026

Copy link
Copy Markdown
Member

Thanks @dikshit-n for the PR. Looks good. let's move forward

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