tslib ^2.0.0 dependency should be ^2.1.0
See original GitHub issueDescribe 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:
- Created 2 years ago
- Reactions:4
- Comments:6 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@trivikr yarn.lock is not used by parent projects when installing dependencies. This is only for developers contributing to this project.
The project is using tslib@2.2.0 as per yarn.lock
https://github.com/aws/aws-sdk-js-v3/blob/c7371b6e90e7729cc6f72434529c6691f1f9be55/yarn.lock#L11332-L11335