#14865·amplify-js

@aws-amplify/datastore potentially uses the wrong version of tslib and errors out

Author: methompsonCreated Jul 6, 2026Updated Jul 9, 2026
Labelsbug

Before opening, please confirm:

JavaScript Framework

Vue

Amplify APIs

Authentication

Amplify Version

v5

Amplify Categories

auth

Backend

None

Environment information

System:
    OS: macOS 26.5.2
    CPU: (10) arm64 Apple M5
    Memory: 165.92 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.22.3 - /Users/work/.nvm/versions/node/v22.22.3/bin/node
    npm: 10.9.8 - /Users/work/.nvm/versions/node/v22.22.3/bin/npm
  Browsers:
    Chrome: 148.0.7778.216
    Firefox Developer Edition: 153.0
    Safari: 26.5.2
    Safari Technology Preview: 26.0
  npmPackages:
    @aws-amplify/ui-vue: ^3.1.30 => 3.1.30 
    @tsconfig/node24: ^24.0.4 => 24.0.4 
    @types/node: ^24.13.2 => 24.13.2 
    @vitejs/plugin-vue: ^6.0.7 => 6.0.7 
    @vue/tsconfig: ^0.9.1 => 0.9.1 (0.1.3)
    apollo-boost: ^0.4.9 => 0.4.9 
    aws-amplify: ^5.3.29 => 5.3.37 
    npm-run-all2: ^9.0.2 => 9.0.2 
    typescript: ~6.0.0 => 6.0.3 
    vite: ^7.3.6 => 7.3.6 
    vite-plugin-vue-devtools: ^8.1.2 => 8.1.5 
    vue: ^3.5.38 => 3.5.39 
    vue-tsc: ^3.3.5 => 3.3.6 
  npmGlobalPackages:
    corepack: 0.34.6
    npm: 10.9.8

Describe the bug

In a project, I've included an old version of apollo-boost, that we've used for ~ 6 years to handle our GraphQL queries (to AppSync, no less). A recent version of aws-amplify, v5.3.37, has caused the application to throw errors immediately when using a dev server via Vite.

Expected behavior

The dev server should work correctly.

Reproduction steps

A minimal reproduction can be found here: https://github.com/methompson/amplify_bug

Steps to reproduce:

  1. Install dependencies with npm ci
  2. Run the dev server with npm run dev

You should observe several errors in the terminal.

Code Snippet

Literally importing from aws-amplify causes the project to error out:

javascript
import { Amplify, Auth, Hub, I18n } from "aws-amplify";

Log output


✘ [ERROR] No matching export in "node_modules/@aws-amplify/datastore/node_modules/tslib/tslib.es6.js" for import "__spreadArray"

    node_modules/@aws-amplify/datastore/lib-esm/util.js:1:51:
      1 │ ...aiter, __generator, __read, __spreadArray, __values } from "tslib";
        │                                ~~~~~~~~~~~~~
        ╵                                __spreadArrays

  Did you mean to import "__spreadArrays" instead?

    node_modules/@aws-amplify/datastore/node_modules/tslib/tslib.es6.js:150:16:
      150 │ export function __spreadArrays() {
          ╵                 ~~~~~~~~~~~~~~


    at failureErrorWithLog (/Users/work/Desktop/work/amplify_bug/node_modules/esbuild/lib/main.js:1748:15)
    at /Users/work/Desktop/work/amplify_bug/node_modules/esbuild/lib/main.js:1207:25
    at /Users/work/Desktop/work/amplify_bug/node_modules/esbuild/lib/main.js:1626:9
    at process.processTicksAndRejections (node:internal/process/task_queues:103:5) {
  errors: [Getter/Setter],
  warnings: [Getter/Setter]
}

aws-exports.js

N/A

Manual configuration

N/A

Additional configuration

N/A

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

I note that the version of tslib installed in node_modules/@aws-amplify/datastore/node_modules/tslib is v1.14.1. I also note that __spreadArray only became a part of the tslib package as of 2.1.0.

This project works fine if aws-amplify v5.3.35 is installed: npm i [email protected].

If I remove the apollo-boost dependency from package.json, then remove node_modules and reinstall, the project functions correctly.

i.e.

rm -rf node_modules package-lock.json && npm i

I imagine specifying a minimum version of tslib v2.1.0 for the @aws-amplify/datastore project would resolve this issue.