question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

tslib ^2.0.0 dependency should be ^2.1.0

See original GitHub issue

Describe the bug

when importing the @aws/client-s3 package to an application that has tslib>=2.0.0,<=2.1.0, the project builds fail with

Attempted import error: '__spreadArray' is not exported from 'tslib'.

This function was introduced in https://github.com/microsoft/tslib/releases/tag/2.1.0 in this PR: https://github.com/microsoft/tslib/pull/133

I believe the current package.json for @aws/client-s3 has tslib: ^2.0.0

Your environment

yarn why tslib
yarn why v1.22.10
[1/4] 🤔  Why do we have the module "tslib"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "tslib@2.0.3"
info Has been hoisted to "tslib"

SDK version number

@aws-sdk/client-s3@3.14.0

Is the issue in the browser/Node.js/ReactNative?

Node.js

Details of the browser/Node.js/ReactNative version

node -v v14.4.0

Steps to reproduce

yarn install and yarn start your application that has multiple packages that depend on tslib, specifically one that depends on one less than 2.1.0

Observed behavior

Attempted import error: '__spreadArray' is not exported from 'tslib'.

Expected behavior

tslib dependency should match the build-time dependency (similar to https://github.com/aws/aws-sdk-js-v3/issues/2207 )

Additional context

A workaround for yarn is to use yarn resolutions feature to force tslib >= 2.1.0

"resolutions": {
    "@aws-sdk/client-s3/tslib": "^2.1.0"
  }

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
vvocommented, Jun 7, 2021

@trivikr yarn.lock is not used by parent projects when installing dependencies. This is only for developers contributing to this project.

1reaction
trivikrcommented, May 27, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

tslib - npm
This is a runtime library for TypeScript that contains all of the TypeScript helper functions. This library is primarily used by the -- ......
Read more >
tslib direct dependency migration - Angular
If you have any libraries within your workspace, this migration will convert tslib peer dependencies to direct dependencies for the libraries.
Read more >
you must install peer dependencies yourself Code Example
npm WARN codelyzer@6.0.1 requires a peer of tslint@^5.0.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.
Read more >
npm WARN ... requires a peer of ... but none is installed. You ...
"A requires a peer of B but none was installed". Consider it as "A requires one of B's peers but that peer was...
Read more >
tslib - NPM Package Overview - Socket.dev
Start using Socket to analyze tslib and its 0 dependencies to secure ... you should absolutely consider using tslib and --importHelpers .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found