-
Notifications
You must be signed in to change notification settings - Fork 106
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 #50
Comments
This seems to be related to storybookjs/storybook#15210 |
Now it only works if I disable all plugins including essential addons., which defies the purpose. Maybe this can help to identify the issue. |
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: |
I'm getting a similar error with Storybook Rolling Vite back to Below are the relevant dependencies. All of the dependencies in my project, including the ones listed below, are the most recent versions available as of today. I am using addons, but the issues still occur if they're disabled, so I omitted them from the list. package.json/dependencies "@storybook/svelte": "6.3.6",
"@storybook/addon-svelte-csf": "1.1.0",
"storybook-builder-vite": "0.0.12",
"svelte": "3.41.0",
"svelte-hmr": "0.14.7",
"svelte-preprocess": "4.7.4",
"@tsconfig/svelte": "2.0.1",
"vite": "2.4.4",
"vite-tsconfig-paths": "3.3.13",
"@sveltejs/vite-plugin-svelte": "1.0.0-next.15", console.error
|
I finally found a solution to this here
Thanks @develar |
@husayt Awesome and thx! This fixed it for us as well 😃 Now we only need to wait for the root problem to be solved. I am wondering if this is a vite builder specific problem or if the root problems lies in the storybook core as others have the same problem with other builders... 🤔 |
For those of you for whom this dedupe solution works 👆, I'm wondering why you have multiple copies of This should help:
|
@shilman System:
OS: Windows 10 10.0.19042
CPU: (8) x64 Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
Binaries:
Node: 16.4.2 - C:\_\Dev\NodeJS\1~6\node.EXE
Yarn: 1.22.10 - C:\_\Dev\NodeJS\16\yarn.CMD
npm: 7.18.1 - C:\_\Dev\NodeJS\16\npm.CMD
Browsers:
Chrome: 93.0.4577.63
Edge: Spartan (44.19041.1023.0), Chromium (93.0.961.38)
npmPackages:
@storybook/addon-actions: 6.3.8 => 6.3.8 Might be because I'm using a Yarn workspace? {
"svelte": "3.42.5",
"@tsconfig/svelte": "2.0.1",
"svelte-hmr": "0.14.7",
"svelte-preprocess": "4.9.4",
"vite": "2.5.7",
"@sveltejs/vite-plugin-svelte": "1.0.0-next.23",
"vite-plugin-optimize-persist": "0.0.5",
"vite-plugin-package-config": "0.0.3",
"vite-tsconfig-paths": "3.3.14",
"@storybook/svelte": "6.3.8",
"@storybook/addon-svelte-csf": "1.1.0",
"storybook-builder-vite": "0.0.12",
"@storybook/addon-actions": "6.3.8",
"@storybook/addon-controls": "6.3.8",
"@storybook/addon-docs": "6.3.8",
"@storybook/addon-events": "6.2.9",
"@storybook/addon-links": "6.3.8",
"@storybook/addon-measure": "6.4.0-alpha.27",
"@storybook/addon-outline": "6.4.0-alpha.27",
"@storybook/addon-postcss": "2.0.0",
"@storybook/addon-storysource": "6.3.8",
"@storybook/addon-toolbars": "6.3.8",
"@storybook/addon-viewport": "6.3.8",
"@storybook/theming": "6.3.8",
"storybook-addon-paddings": "4.2.1",
"storybook-addon-pseudo-states": "1.0.0",
"storybook-addon-themes": "6.1.0",
"storybook-dark-mode": "1.0.8",
"storybook-facelift": "6.9.0",
"storybook-stylesheet-toggle": "0.1.3"
} |
If you downgrade addon-measure and addon-outline to 6.3.8, and remove addon-events, does that fix it without the dedupe? |
So neither of those seems to actually have a Here is the reduced dependency list: {
"svelte": "3.42.5",
"@tsconfig/svelte": "2.0.1",
"svelte-hmr": "0.14.7",
"svelte-preprocess": "4.9.4",
"vite": "2.5.7",
"@sveltejs/vite-plugin-svelte": "1.0.0-next.23",
"vite-plugin-optimize-persist": "0.0.5",
"vite-plugin-package-config": "0.0.3",
"vite-tsconfig-paths": "3.3.14",
"@storybook/svelte": "6.3.8",
"@storybook/addon-svelte-csf": "1.1.0",
"storybook-builder-vite": "0.0.12",
} |
I can confirm that I ran into the same problem using |
I ran into it too, even with |
Closes #50 Closes #157 This is the same fix as storybookjs/storybook#11092
Re-opening this since we reverted the fix. Something interesting I found is that this error does not occur when storyStoreV7 is enabled even though duplicate ClientApi files are included in the bundle. Also including some context from #157 this happens because |
I'm hitting this issue to using Environment Info:
System:
OS: macOS 12.1
CPU: (10) arm64 Apple M1 Max
Binaries:
Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
Yarn: 3.1.1 - ~/.nvm/versions/node/v16.13.0/bin/yarn
npm: 8.1.3 - ~/.nvm/versions/node/v16.13.0/bin/npm
Browsers:
Chrome: 97.0.4692.99
Edge: 97.0.1072.69
Firefox: 96.0.2
Safari: 15.2
npmPackages:
@storybook/addon-essentials: next => 6.5.0-alpha.23
@storybook/addon-links: next => 6.5.0-alpha.23
@storybook/vue3: next => 6.5.0-alpha.23 Using module.exports = {
features: {
storyStoreV7: true,
},
} to get by for now |
@spacedawwwg do you happen to have a reproduction that you can share? |
@IanVS sure, just popped it together: https://github.com/spacedawwwg/storybook-vite-issues As I say above, I can get around the issue by using storyStoreV7 for now, but it'd be nice to to have to const path = require('path');
module.exports = {
addons: ['@storybook/addon-essentials'],
core: {
builder: 'storybook-builder-vite',
},
// TODO: understand why storyStoreV7 required
// (due to issues with storybook-builder-vite + @storybook/vue3 + @storybook/addon-essentials)
features: {
storyStoreV7: true,
},
framework: '@storybook/vue3',
staticDirs: ['public'],
stories: [
// documentation stories
'../docs/index.stories.mdx',
// component stories
'../packages/**/*.docs.stories.mdx',
'../packages/**/__stories__/*.stories.@(js|jsx|ts|tsx)',
],
async viteFinal(config) {
// dedupe required
// TODO: follow https://github.com/eirslett/storybook-builder-vite/issues/50
config.resolve.dedupe = ['@storybook/client-api'];
// quick aliases
config.resolve.alias['#root'] = path.resolve(__dirname, '../');
config.resolve.alias['#storybook'] = path.resolve(__dirname, '../.storybook');
return config;
},
}; |
Is there a reason that addon-essentials is not at the same version as the others? Storybook generally expects to all be at the same version, or it causes problems like you're experiencing now. |
@IanVS that was a mixup when I was creating the repo. I've updated them all to |
The issue (when trying to run the examples)Multiple "versions" of ClientApi.js. Running
These are all at WorkaroundRemove the nested versions of rm -rf ./node_modules/@storybook/svelte/node_modules/@storybook/client-api
rm -rf ./node_modules/@storybook/vue3/node_modules/@storybook/client-api or force using the same folder using the |
It's still a mystery why there are multiples of them. I can't for the life of me figure out why yarn is not de-duplicating them. |
I had the same problem when using In my case, the point is that just add .pnpmfile.cjs module.exports = {
hooks: {
readPackage(pkg, ctx) {
if (pkg.name === '@storybook/vue3') {
packageJson.peerDependencies['react'] = '^16.8.0 || ^17.0.0';
packageJson.peerDependencies['react-dom'] = '^16.8.0 || ^17.0.0';
}
},
},
}; |
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:
Has anyone seen something similar perhaps?
I am using vue3 on windows.
The text was updated successfully, but these errors were encountered: