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

Uncaught Error: Singleton client API not yet initialized, cannot call addParameters after upgraded from 6.3.0-beta.16 to 17 #15210

Closed
litan1106 opened this issue Jun 11, 2021 · 16 comments

Comments

@litan1106
Copy link

client_api.js:50 Uncaught Error: Singleton client API not yet initialized, cannot call addParameters
    at addParameters (client_api.js:50)
    at vite-app.js:75
    at Array.forEach (<anonymous>)
    at vite-app.js:61
    at Array.forEach (<anonymous>)
    at vite-app.js:60
@litan1106
Copy link
Author

fixed with 6.3.0-rc.4 and vite builder 0.0.8

@sadir
Copy link

sadir commented Jun 25, 2021

@litan1106 I've just upgraded from 6.2.9 to 6.3.0 and run into this error. What was the issue you fixed? Not seeing anything here that jumps out at me.

We have a custom webpack config so I assume that's got something to do with it?

@bufordeeds
Copy link

My team is running into the same issue after upgrading today.

@husayt
Copy link

husayt commented Jun 27, 2021

I am seeing the same issue as well after building with vite-builder and vue3 project.

@shilman
Copy link
Member

shilman commented Jun 27, 2021

Please file Vite-related issues in https://github.com/eirslett/storybook-builder-vite/

Thank you! 🙏

@sadir
Copy link

sadir commented Jun 28, 2021

Ours isn't vite related @shilman - can you set my expectations here on what will happen next please?

@sadir
Copy link

sadir commented Jun 28, 2021

I can post some of our config if that would help? Don't have a repo to share with you. Or open a new issue?

@sadir
Copy link

sadir commented Jun 28, 2021

Here's the error we are getting

Uncaught Error: Singleton client API not yet initialized, cannot call addParameters
    at addParameters (client_api.js:105)
    at eval (config.js-generated-other-entry.js:41)
    at Array.forEach (<anonymous>)
    at eval (config.js-generated-other-entry.js:15)
    at Module../node_modules/@storybook/addon-docs/dist/esm/frameworks/common/config.js-generated-other-entry.js (main.iframe.bundle.js:2523)
    at __webpack_require__ (main.iframe.bundle.js:836)
    at fn (main.iframe.bundle.js:130)
    at eval (client.js:5)
    at Object.0 (main.iframe.bundle.js:44637)
    at __webpack_require__ (main.iframe.bundle.js:836)

@shilman
Copy link
Member

shilman commented Jun 29, 2021

@sadir Can you please create a reproduction by running npx sb@next repro, following the instructions, and linking it in your issue description? We prioritize issues with reproductions over those without. Thank you! 🙏

@jokull
Copy link

jokull commented Jun 29, 2021

Same here when upgrading to 6.3. Removing all addons makes it work — except the postcss addon, that doesn't trigger this error. The addons I've tried adding that trigger this are links, essentials and docs.

@sadir
Copy link

sadir commented Jul 2, 2021

Upgrading to 6.3.2 seems to have fixed this issue for us, whatever it was!

@martinsuba
Copy link

martinsuba commented Jul 8, 2021

I'm getting the same error after upgrading from 6.1.11. to 6.3.2. I've also tried upgrading to 6.4.0-alpha.12 (with webpack 5) and the result is same, except now I'm also getting this in console:
99% done plugins webpack-hot-middlewarewebpack built preview dbb930f7764ba3c321a1 in 1409ms

@jaakerisalu
Copy link

jaakerisalu commented Jul 8, 2021

Hey I also ran into this issue after upgrading all packages to 6.3.2. This seems to be the same problem as #10887, so I ran

> npm ls | grep client-api
│ ├─┬ @storybook/[email protected]
│ │ ├─┬ @storybook/[email protected]
│ │ ├─┬ @storybook/[email protected]
│ │ │ ├─┬ @storybook/[email protected]
│ │ ├─┬ @storybook/[email protected]
│ │ ├─┬ @storybook/[email protected]
│ ├── @storybook/[email protected] deduped
│ │ ├─┬ @storybook/[email protected]

> npm dedupe
removed 27 packages and audited 3738 packages in 7.686s

> npm ls | grep client-api
│ ├─┬ @storybook/[email protected]
│ │ ├── @storybook/[email protected] deduped
│ │ ├── @storybook/[email protected] deduped
│ │ │ ├── @storybook/[email protected] deduped
│ │ ├── @storybook/[email protected] deduped
│ │ ├── @storybook/[email protected] deduped
│ ├── @storybook/[email protected] deduped
│ │ ├── @storybook/[email protected] deduped

And the error is gone (for now).

Here are the Storybook packages I'm using

    "@storybook/addon-a11y": "6.3.2",
    "@storybook/addon-essentials": "6.3.2",
    "@storybook/addon-links": "6.3.2",
    "@storybook/addons": "6.3.2",
    "@storybook/builder-webpack5": "6.3.2",
    "@storybook/manager-webpack5": "6.3.2",
    "@storybook/react": "6.3.2",

And it seems even on a fresh npm install, after removing old node_modules, the storybook dependencies include 24 duplicate instances that npm dedupe can erase.

@martinsuba
Copy link

Thanks @jaakerisalu but it didn't help my case. I've seen issue #10887 but that didn't help me either.

@andre-brdoch
Copy link
Contributor

I encountered this issue (again after several times in the past) after updating to v6.4.1. Removing any webpack modifications fixed the issue. Not sure what caused it to begin with. However, this also made me realize that most of our webpack modifications were unnecessary, since nowadays storybook has many things covered via presets

@blowsie
Copy link

blowsie commented Jan 17, 2022

Im seeing this issue with
^6.5.0-alpha.19

Cleaned node_modules and lock file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants