Open arkmech opened 3 months ago
Could you try removing the getAbsolutePath
call from the svelte addon, and just have the plain string?
It came when I setup Storybook, since I use pnpm
and turborepo
.
In, main.ts
/**
* This function is used to resolve the absolute path of a package.
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
*/
function getAbsolutePath(value: string): any {
return dirname(require.resolve(join(value, "package.json")));
}
Could you try removing the
getAbsolutePath
call from the svelte addon, and just have the plain string?
If I do remove it, then yeah storybook starts up. But thats because its no longer referencing the package in node_modules
. But the *.stories.svelte
is causing the issue after that.
Okay.
Please share a minimal reproduction repo that we can investigate.
See https://storybook.js.org/docs/contribute/how-to-reproduce
Yeah I'm actually thinking this is a Svelte 5 compatibility issue, I think I will just wait till Svelte 5 is released and Storybook has full support for Svelte 5. Thanks
Yeah I'm actually thinking this is a Svelte 5 compatibility issue, I think I will just wait till Svelte 5 is released and Storybook has full support for Svelte 5. Thanks
We just released support for Svelte 5 in a prerelease, maybe that helps you. See https://github.com/storybookjs/addon-svelte-csf/discussions/191
You can try it out with npm install @srorybook/addon-svelte-csf@next
Describe the bug
In
main.ts
, adding@storybook/addon-svelte-csf
to theaddons
array. Storybook exists. When removing the@storybook/addon-svelte-csf
, storybook server starts ok.It doesn't recognize the
<
from the Svelte components (Meta)<script>
tag form the node modules.Something wrong from
main.ts
SB_CORE-SERVER_0002 (CriticalPresetLoadError): Storybook failed to load the following preset: ./.storybook/main.ts.
Coming from this addon.
SB_CORE-SERVER_0002 (CriticalPresetLoadError): Storybook failed to load the following preset: /Users/me/Dev/project/node_modules/@storybook/addon-svelte-csf/dist/index.js.
Specifically the
<
from the script tag.My
.main.ts
Steps to reproduce the behavior
@storybook/addon-svelte-csf
to the addons array and.stories.svelte
to thestories
arrayExpected behavior
Storybook Server to properly load the
@storybook/addon-svelte-csf
addon and be able to write stories in Svelte CSF, akaButton.stories.svelte
Environment