Closed xistz closed 3 years ago
I experience the same issue, is there a workaround? I receive this error with yarn v2:
ERR! Error: storybook-addon-next-router tried to access tslib, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
And npm does fail with the error above.
I am not familiar with dependency resolution but I managed to work around it by running npm i -D tslib@2.3.0
@xistz I can remove tslib, but that would make the code larger, pretty sure other libraries that are written with TS can take advantage of tslib which will ultimately result in a smaller bundle size for you.
@lifeiscontent
After a bit more investigation, I realised the issue could have also arose because my other packages were depending on an older version of tslib which didn't have __spreadArray
. Whenever those packages get updated, it will be probably be resolved.
Until then, manually installing tslib is a workaround so I think it should be fine to leave it in.
Thanks for your help!
Thank you creating the addon. The addon fails to start if npm is used as the package manager. The issue seems to be with tslib and how npm/yarn manages package versions. The issue can be reproduced in this repository
https://github.com/xistz/next-storybook-addon-next-router
steps taken to create the respective directories
npm
yarn
error message from when starting storybook in the npm directory