tslib should be a peer dependency
See original GitHub issuetslib ^2.3.0
is listed as a dev dependency. My project does not have a direct dependency on tslib
. One of my other dependencies used tslib 1.x
as its dependency. Hence the tslib
under my node_modules
was of version 1.x. If I run:
npm run storybook
to run Storybook, I get this error:
info @storybook/react v6.3.7
info
info => Loading presets
ERR! TypeError: tslib_1.__spreadArray is not a function
ERR! at Object.config (/Users/masum/Projects/ieims-next/node_modules/storybook-addon-next-router/dist/preset.js:7:42)
ERR! at /Users/masum/Projects/ieims-next/node_modules/@storybook/core-common/dist/cjs/presets.js:274:28
ERR! at processTicksAndRejections (node:internal/process/task_queues:96:5)
This package needs tslib 2.3.0+
to run. Any package using it must have this version of tslib or better. Hence it should be declared as a dependency or peer dependency.
As it is always used as a library and as tslib
is often used by other packages, it probably makes better sense to declare the tslib
dependency as a peer dependency.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:5 (2 by maintainers)
Top Results From Across the Web
tslib must be a dependency and not a devDependency #372
Technically tslib must be a dependency of @dojo/core (because it is). You can just let NPM figure out how it dedupes and optimalizes...
Read more >tslib direct dependency migration - Angular
If tslib remained declared as a library peer dependency, it would be possible for some Angular workspaces to get into a state where...
Read more >Do we need the Angular Library tslib peer dependency when ...
The FESM package generated by the Angular Package Format uses it so I'll just leave it as a peer dependency. This is a...
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. typescript by devops ......
Read more >tslib versions and peer dependencies - NPM Peer
Online Peer dependency version tool to search for compatible versions of related NPM packages.
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 FreeTop 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
Top GitHub Comments
@arjansingh @unixdev my bad, I’ll fix that now.
Yup looks like we are good. Thanks!