-
Notifications
You must be signed in to change notification settings - Fork 32
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] Not working with getAbsolutePath('@storybook/addon-svelte-csf')
in Storybook 8
#174
Comments
I am not seeing this in a minimal setup. Here's a sandbox that works fine with Storybook 8 and this addon: https://stackblitz.com/edit/github-mbaaau-wqykp4?file=src%2FButton.stories.svelte Could you provide a minimal reproduction with a repo that I can check out? Here are docs on how to create a minimal reproduction locally https://storybook.js.org/docs/contribute/how-to-reproduce, alternatively you can use https://storybook.new to create a minimal reproduction in StackBlitz. Storybook sandboxes are just a given framework (in this case Svelte + Vite) with |
I ran into this issue. I found that a fix was to remove the getAbsolutePath addons: [
'@storybook/addon-svelte-csf',
getAbsolutePath('@storybook/addon-links'),
getAbsolutePath('@storybook/addon-essentials'),
getAbsolutePath('@chromatic-com/storybook'),
getAbsolutePath('@storybook/addon-interactions')
], |
This works for me as well |
getAbsolutePath('@storybook/addon-svelte-csf')
in Storybook 8
The op's issue is because he is using a monorepo called moonrepo I can confirm this is also bugged with turborepo, and the fix is the same. |
@ChrisKnightLDN Fixed my immediate issue and the server was able to start (I am also using turborepo sveltekit), but then I got a different error after the server started up: On the server:
On the client:
|
Having a similar issue.
Source files: gitbutlerapp/gitbutler@master...svelte-csf `DemoButton.stories.svelte`<script module lang="ts">
import Button from '$lib/Button.svelte';
import iconsJson from '$lib/data/icons.json';
import { defineMeta } from '@storybook/addon-svelte-csf';
const { Story } = defineMeta({
title: 'Inputs / Button',
component: Button,
args: {
type: 'button',
size: 'tag',
style: 'pop'
},
argTypes: {
icon: { control: 'select', options: Object.keys(iconsJson) },
type: { control: 'select', options: ['button', 'submit', 'reset'] },
width: { control: 'text' },
size: { control: 'select', options: ['tag', 'button', 'cta'] },
align: {
control: 'select',
options: ['center', 'left', 'right', 'space-between']
},
style: {
control: 'select',
options: ['neutral', 'ghost', 'pop', 'success', 'error', 'warning', 'purple']
},
kind: { control: 'select', options: ['solid', 'soft'] }
}
});
</script>
<Story name="Demo Button" />
Server output Internal server error: Could not find variable declaration from 'defineMeta' call in the compiled output of the stories file: file:///opt/gitbutler/gitbutler/packages/ui/src/stories/button/DemoButton.stories.svelte
More info: https://github.com/storybookjs/addon-svelte-csf/blob/v5.0.0-next.11/ERRORS.md#SB_SVELTE_CSF_PARSER_EXTRACT_COMPILED_0002
Plugin: storybook:addon-svelte-csf-plugin-post
File: /opt/gitbutler/gitbutler/packages/ui/src/stories/button/DemoButton.stories.svelte
at extractCompiledASTNodes (/opt/gitbutler/gitbutler/node_modules/.pnpm/@[email protected]_@[email protected][email protected]_prettier@3._qfz2bs4ci7erg6gicuv6gaoow4/node_modules/@storybook/addon-svelte-csf/dist/parser/extract/compiled/nodes.js:81:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async TransformContext.transform (/opt/gitbutler/gitbutler/node_modules/.pnpm/@[email protected]_@[email protected][email protected]_prettier@3._qfz2bs4ci7erg6gicuv6gaoow4/node_modules/@storybook/addon-svelte-csf/dist/compiler/plugins.js:78:38)
at async Object.transform (file:///opt/gitbutler/gitbutler/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-DEPSZ3SS.js:52318:30)
at async loadAndTransform (file:///opt/gitbutler/gitbutler/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-DEPSZ3SS.js:55073:29) |
@ndom91 based on the error shown that looks unrelated to this, could you open a new issue? |
Interestingly, I tried to set it up again from scratch and it now works with |
Note
This issue has a possible workaround
Describe the bug
A clear and concise description of what the bug is.
Steps to reproduce the behavior
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots and/or logs
Environment
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: