You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On a clean and fresh install of Turbobuil from npx create-turbo@latest -e with-svelte then, using the npx sv create with tailwind and storybook (typescript) in the apps directory.
Output from the terminal.
12:49:17 PM [vite] Internal server error: Unexpected character '@'
Plugin: storybook:svelte-docgen-plugin
File: {path to turbo build directory}/apps/ui-docs/src/stories/Page.stories.svelte:3:2
4: </script>
5:
6: {@render children()}
^
at error ({path to turbo build directory}/node_modules/svelte/compiler.cjs:14256:16)
at Parser.error ({path to turbo build directory}/node_modules/svelte/compiler.cjs:14404:3)
at Parser.acorn_error ({path to turbo build directory}/node_modules/svelte/compiler.cjs:14391:8)
at read_expression ({path to turbo build directory}/node_modules/svelte/compiler.cjs:9641:10)
at mustache ({path to turbo build directory}/node_modules/svelte/compiler.cjs:13965:22)
at new Parser ({path to turbo build directory}/node_modules/svelte/compiler.cjs:14352:12)
at parse ({path to turbo build directory}/node_modules/svelte/compiler.cjs:14529:17)
at parseHtmlx ({path to turbo build directory}/node_modules/svelte2tsx/index.js:1679:22)
at processSvelteTemplate ({path to turbo build directory}/node_modules/svelte2tsx/index.js:7742:32)
at Object.svelte2tsx ({path to turbo build directory}/node_modules/svelte2tsx/index.js:7753:187)
It's specifically for running in a mono repo, but it works just fine when created from sv create.
On a side note, to get it to start working, I have to remove @getAbsolutePath() from both the addons and framework in main.ts.
** Disclaimer** This information might be inaccurate, due to it being generated automatically
This appears to be an issue with the Svelte docgen plugin not properly handling the @render syntax from Svelte 5. The error occurs in the svelte2tsx transformation step. Key changes needed: 1. Update svelte2tsx handling in @storybook/svelte-docgen-plugin to support Svelte 5's @render syntax: - Location: node_modules/@storybook/svelte-docgen-plugin/dist/index.js - The plugin needs to be updated to use a newer version of svelte2tsx that supports Svelte 5 syntax 2. As a temporary workaround, you can: - Remove the docgen plugin from .storybook/main.ts: ts export default { framework: '@storybook/svelte-vite', addons: [ // Remove @storybook/addon-svelte-csf if present ] };
About Greptile
This response provides a starting point for your research, not a precise solution.
Help us improve! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
The template from create-turbo seems to be outdated.
I don't know what the use case for getAbsolutePath() in the first place, nor can I find which CLI is responsible for generating it. Did you add it manually? Based on some guide?
Seeing the error message trace - my first hunch was that in this project repository, a legacy version of Svelte is being in use - v4, because {@render ...} is a part of Svelte v5 features.
... and I confirmed it with:
I'm not convinced this bug is related to Storybook or @storybook/addon-svelte-csf. But rather a misconfigured project repository setup with monorepo with outdated template or guides.
Describe the bug
On a clean and fresh install of Turbobuil from
npx create-turbo@latest -e with-svelte
then, using thenpx sv create
with tailwind and storybook (typescript) in the apps directory.Output from the terminal.
It's specifically for running in a mono repo, but it works just fine when created from
sv create
.On a side note, to get it to start working, I have to remove
@getAbsolutePath()
from both the addons and framework inmain.ts.
Reproduction link
https://github.com/NickLikesPHP/svelte5-turbobuild-storybook-not-working
Reproduction steps
npm run dev
to start Turbo Buildnpm run dev
again[plugin:storybook:svelte-docgen-plugin] Unexpected character '@'
when you click the 'Configure your project' page at the topSystem
Additional context
I'm on my Mac now but had the same error on my Windows desktop.
The text was updated successfully, but these errors were encountered: