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 should be a peer dependency

See original GitHub issue

tslib ^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:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
lifeiscontentcommented, Sep 4, 2021

@arjansingh @unixdev my bad, I’ll fix that now.

0reactions
arjansinghcommented, Sep 10, 2021

Yup looks like we are good. Thanks!

Read more comments on GitHub >

github_iconTop 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 >

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