-
Notifications
You must be signed in to change notification settings - Fork 32
-
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]: SyntaxError: Unexpected token '<', Storybook Core Server doesn't know how to process Svelte files #189
Comments
Could you try removing the |
It came when I setup Storybook, since I use In, /**
* 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")));
} |
If I do remove it, then yeah storybook starts up. But thats because its no longer referencing the package in |
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 |
We just released support for Svelte 5 in a prerelease, maybe that helps you. See #191 You can try it out with |
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
The text was updated successfully, but these errors were encountered: