Open gabek opened 1 year ago
is there anyway to fix this?
I encountered the same (or similar) issue upgrading from 7.4.5
to 7.5.1
(or 7.5.0
for what matters)
running
storybook dev -c .storybook
shows this error in console when I try to access the storybook link for that mdx file
3:39:08 PM [vite] Internal server error: Could not parse expression with acorn: Unexpected content after expression
Plugin: storybook:mdx-plugin
File: /Users/cesar.santos/repositories/test/packages/introduction.mdx:undefined:undefined
It seems the error I'm facing got introduced in #24166 - it works fine if I use v7.5.0-alpha.3
I had a bit of a mess on my storybook dependencies. This fixed it for me
diff --git a/package.json b/package.json
--- a/package.json (revision 959784332c9d9d377cbda65e002baaf893b9ab0e)
+++ b/package.json (date 1697751750935)
@@ -19,15 +19,11 @@
"@semantic-release/changelog": "6.0.2",
"@semantic-release/error": "3.0.0",
"@semantic-release/git": "10.0.1",
- "@storybook/addon-actions": "7.5.1",
- "@storybook/addon-docs": "7.5.1",
"@storybook/addon-essentials": "7.5.1",
"@storybook/addon-interactions": "7.5.1",
"@storybook/addon-links": "7.5.1",
- "@storybook/addons": "7.5.1",
- "@storybook/components": "7.5.1",
- "@storybook/core-events": "7.5.1",
- "@storybook/node-logger": "7.5.1",
+ "@storybook/blocks": "7.5.1",
+ "@storybook/manager-api": "7.5.1",
"@storybook/react": "7.5.1",
"@storybook/react-vite": "7.5.1",
"@storybook/theming": "7.5.1",
@@ -66,7 +62,7 @@
"storybook": "7.5.1",
"tsup": "7.2.0",
"typescript": "5.2.2",
- "vite": "4.4.9",
+ "vite": "4.5.0",
"vite-plugin-tsconfig-paths": "1.3.1",
"webpack": "5.88.2"
},
If anyone here could create a minimal reproduction that demonstrates this behavior it would be great. You can create a StackBlitz project at storybook.new and link to it. You can also create a minimal sandbox locally, see repro docs.
Thank you! 🙏
It's been a while since I've tried, but I thought I'd try again with the most recent version of Storybook, and it miraculously works now.
I'm experiencing the same issue that @csantos1113 after upgrading Storybook from v7.3.2 to v7.5.x
Here is a link to repro the issue for my project.
During the migration process a function of getAbsolutePath
was added to the addons section of the .storybook/main.ts
file. Removing that function fixed the issue for me.
In the above example if you comment out the getAbsolutePath
addons and uncomment just the strings, the error goes away.
Here is a link to repro the issue for my project.
During the migration process a function of
getAbsolutePath
was added to the addons section of the.storybook/main.ts
file. Removing that function fixed the issue for me.In the above example if you comment out the
getAbsolutePath
addons and uncomment just the strings, the error goes away.
This fixed the issue for me, I just removed the getAbsolutePath
for @storybook/addon-docs
and the error is gone.
In my case, updating @storybook/vue3-vite
from version 7.4.6
to 7.5.3
resolved the issue.
I think this discussion is related. A repro was linked in the comments there.
I'm also seeing this in my Qwik framework plugin repo whenever I update past 7.5.0. Here's a repro (run yarn
, yarn build
, then yarn storybook
)
Hi there! Thank you for opening this issue, but it has been marked as stale
because we need more information to move forward. Could you please provide us with the requested reproduction or additional information that could help us better understand the problem? We'd love to resolve this issue, but we can't do it without your help!
@literalpie thanks so much for the reproduction.
the problem is that your monorepo is using an older version of builder-vite
with a newer version of addon-docs
. PR #24166 moves the MDX handling out of builder-vite
and into addon-docs
. When you use the old builder-vite
it causes the MDX to be compiled twice. So the second time it compiles, it's trying to compile JS instead of MDX, which errors.
You can see this by running the following in your project:
yarn why @storybook/builder-vite
When I nuke the lockfiles and restart, it works again.
I can confirm making sure deps are in sync fixed it. Thank you!
Describe the bug
Hello! I'm attempting to migrate over to Storybook v7 and I'm having issues building with standalone/unattached Mdx files. I've tried all different versions of suggested syntaxes in the documentation, including the suggestion that you can drop the
Meta
tag completely.Could you point me in the right direction?
Console output
npm run storybook
To Reproduce
The following
Test.mdx
reproduces the error.Test.mdx
System
Additional context
No response