Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: runGetVersions doesn't always return an array causing errors #23619

Open
malwatkins opened this issue Jul 26, 2023 · 1 comment
Open

Comments

@malwatkins
Copy link

Describe the bug

the code calls constraint?(await this.runGetVersions(packageName, !0)).reverse(), however rungetVersions does not always return an array

If there is only 1 version available (e.g. in a company npm registry) this throws the error "(intermediate value).reverse is not a function" (.reverse is a function that exists on arrays)

Workaround:
Add another older version of the packages to the registry so that runGetVersions returns an array with 2 entries

Potential fix:
runGetVersions should return an array with 1 entry

To Reproduce

No response

System

No response

Additional context

No response

@valotas
Copy link

valotas commented Aug 15, 2023

We run into the same issue having the following error while trying to resolve the versions of the libraries:

 • Adding Storybook support to your "Vue 3" app
  ⠼ Getting the correct version of 10 packages
     (intermediate value).reverse is not a function

     Error: (intermediate value).reverse is not a function
    at NPMProxy.getVersion (C:\Users\foo\AppData\Local\npm-cache\_npx\bc7e1e37fcb46ffc\node_modules\@storybook\cli\dist\generate.js:56:48)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async C:\Users\foo\AppData\Local\npm-cache\_npx\bc7e1e37fcb46ffc\node_modules\@storybook\cli\dist\generate.js:54:738
    at async Promise.all (index 7)
    at async baseGenerator (C:\Users\foo\AppData\Local\npm-cache\_npx\bc7e1e37fcb46ffc\node_modules\@storybook\cli\dist\generate.js:76:477)
    at async generator9 (C:\Users\foo\AppData\Local\npm-cache\_npx\bc7e1e37fcb46ffc\node_modules\@storybook\cli\dist\generate.js:105:1002)
    at async installStorybook (C:\Users\foo\AppData\Local\npm-cache\_npx\bc7e1e37fcb46ffc\node_modules\@storybook\cli\dist\generate.js:109:789)
    at async doInitiate (C:\Users\foo\AppData\Local\npm-cache\_npx\bc7e1e37fcb46ffc\node_modules\@storybook\cli\dist\generate.js:114:845)
    at async withTelemetry (C:\Users\foo\AppData\Local\npm-cache\_npx\bc7e1e37fcb46ffc\node_modules\@storybook\core-server\dist\index.js:113:3630)
    at async initiate (C:\Users\foo\AppData\Local\npm-cache\_npx\bc7e1e37fcb46ffc\node_modules\@storybook\cli\dist\generate.js:126:250)

andrasczeh added a commit to andrasczeh/storybook that referenced this issue Sep 23, 2024
andrasczeh added a commit to andrasczeh/storybook that referenced this issue Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants