Closed MacroMan closed 6 months ago
I found some other issues with the same error:
8.0.0-alpha.6
, but the error remains for me on that versionI think the error originates from globals.ts
, and looking at @storybook/global
it seems that global
from import { global } from '@storybook/global';
should always be set, so not really sure of the underlying cause
@ndelangen something is wrong with @storybook/global
and it is manifesting itself in a variety of contexts. Prioritizing this issue since we have a repro available, but @dannyhw have also encountered something similar on his RN work recently.
@shilman @storybook/global
didn't change.
Could it be that something upstream in the builder changed? vite?
I think the error that I see, is caused to the same underlying issue. When toggling a boolean control between false and true, the following error appears:
Error: Cannot read properties of undefined (reading 'some')
at ReactiveEffect.fn (/node_modules/.cache/sb-vite/deps/chunk-47INPIQA.js?v=8deed6a3:1402:17))
at ReactiveEffect.run (/node_modules/.cache/sb-vite/deps/chunk-47INPIQA.js?v=8deed6a3:1198:23))
at get value [as value] (/node_modules/.cache/sb-vite/deps/chunk-47INPIQA.js?v=8deed6a3:1413:68))
at Proxy._sfc_render (/src/components/singleCase/ActionButtons.vue:159:68))
at renderComponentRoot (/node_modules/.cache/sb-vite/deps/chunk-47INPIQA.js?v=8deed6a3:2262:17))
at ReactiveEffect.componentUpdateFn [as fn] (/node_modules/.cache/sb-vite/deps/chunk-47INPIQA.js?v=8deed6a3:6653:26))
at ReactiveEffect.run (/node_modules/.cache/sb-vite/deps/chunk-47INPIQA.js?v=8deed6a3:1198:23))
at instance.update (/node_modules/.cache/sb-vite/deps/chunk-47INPIQA.js?v=8deed6a3:6706:17))
at updateComponent (/node_modules/.cache/sb-vite/deps/chunk-47INPIQA.js?v=8deed6a3:6515:18))
There is no some
in my code, afaict.
I tried different versions and it seems this error was introduced in 7.6.0. Can you confirm that for your situation as well, @MacroMan ?
I first thought it might be related to the update to vite 5, but when downgrading to storybook 7.5.3, it keeps vite 5 as sub-dependency. Not sure what is bundled in it though.
Heres my comment about what I encountered for reference. Though I'm not sure its the same thing.
https://github.com/storybookjs/storybook/pull/25296#issuecomment-1875642613
My issue seems to come from the cjs bundling generating a dynamic require function in addon-actions. Looks like the cjs bundling is targetting node and so that might explain why it behaves differently.
In the issue here it looks like something in storybook vue maybe? though if you can resolve mjs instead maybe that fixes your issue.
@bodograumann I checked back to version 7.0.n and all exhibit the same error, so I suspect this is a downstream issue
Thanks @MacroMan . I have hidden my comment as off-topic and will try to create a separate reproduction.
Is there any workaround that will let me add to the Vue instance without setup()
? I just need to use Vue.use()
@ndelangen by any chance is this fixed already since you changed the bundle target for tsup?
I'm looking at the repro, and AFAIK it makes not sense to be calling this in main.ts
or is there?
import { setup } from "@storybook/vue3"
setup((app) => {
// app.use(Plugin);
});
Should this code be located inside of preview.ts
instead?
@MacroMan
I upgraded the repro and moved the code as described above and storybook started, no problem.
Describe the bug
When using
setup()
from@storybook/vue3
in.storybook/main.ts
:the following error is thrown:
To Reproduce
https://stackblitz.com/edit/github-2zq7kx?file=.storybook%2Fmain.ts
System
Additional context
Tested and have same error with storybook
7.6.4
,7.6.7
and8.0.0-alpha.6