builder-vite: Uncaught Error: Singleton client API not yet initialized, cannot call addParameters

I have managed to get storybook running with start-storybook. I have also now managed to get the build compete. But when I open the generated SB page I get the following error:

iframe.778fe525.js:33 Uncaught Error: Singleton client API not yet initialized, cannot call addParameters
    at addParameters (iframe.778fe525.js:33)
    at iframe.778fe525.js:90
    at Array.forEach (<anonymous>)
    at iframe.778fe525.js:90
    at Array.forEach (<anonymous>)
    at iframe.778fe525.js:90

Has anyone seen something similar perhaps?

I am using vue3 on windows.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 7
  • Comments: 22 (6 by maintainers)

Commits related to this issue

Most upvoted comments

I finally found a solution to this here I will just copy the correct answer, as it solved this for once:

The solution for vite builder — force dedupe (see https://github.com/eirslett/storybook-builder-vite#customize-vite-config):

async viteFinal(config, {configType}) {
    config.resolve.dedupe = ["@storybook/client-api"]
    return config
},

Thanks @develar

@IanVS that was a mixup when I was creating the repo. I’ve updated them all to next (on the repo above) and it’s the same issue.