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
Describe the bug
When importing both default and named exports into an mdx file, an error is produced, crashing the app. The app in question has previewMdx2 set to true.
To Reproduce
Steps to reproduce the behavior:
Create a Component.stories.tsx file with a default export with meta args:
Extraction error on src/components/pills/Pill/Pill.stories.mdx: TypeError: Cannot read properties of undefined (reading 'name')
/Users/morleytatro/Documents/worktrees/gui-webpack-cypress-percy-upgrades/node_modules/@storybook/mdx1-csf/dist/cjs/sb-mdx-plugin.js:38
const attr = elt.attributes.find(n => n.name.name === what);
^
TypeError: Cannot read properties of undefined (reading 'name')
at /Users/morleytatro/Documents/worktrees/gui-webpack-cypress-percy-upgrades/node_modules/@storybook/mdx1-csf/dist/cjs/sb-mdx-plugin.js:38:48
at Array.find (<anonymous>)
at getAttr (/Users/morleytatro/Documents/worktrees/gui-webpack-cypress-percy-upgrades/node_modules/@storybook/mdx1-csf/dist/cjs/sb-mdx-plugin.js:38:31)
at genMeta (/Users/morleytatro/Documents/worktrees/gui-webpack-cypress-percy-upgrades/node_modules/@storybook/mdx1-csf/dist/cjs/sb-mdx-plugin.js:285:21)
at getExports (/Users/morleytatro/Documents/worktrees/gui-webpack-cypress-percy-upgrades/node_modules/@storybook/mdx1-csf/dist/cjs/sb-mdx-plugin.js:382:15)
at /Users/morleytatro/Documents/worktrees/gui-webpack-cypress-percy-upgrades/node_modules/@storybook/mdx1-csf/dist/cjs/sb-mdx-plugin.js:506:21
at Array.forEach (<anonymous>)
at extractExports (/Users/morleytatro/Documents/worktrees/gui-webpack-cypress-percy-upgrades/node_modules/@storybook/mdx1-csf/dist/cjs/sb-mdx-plugin.js:505:17)
at Compiler (/Users/morleytatro/Documents/worktrees/gui-webpack-cypress-percy-upgrades/node_modules/@storybook/mdx1-csf/dist/cjs/sb-mdx-plugin.js:551:29)
at Function.stringify (/Users/morleytatro/Documents/worktrees/gui-webpack-cypress-percy-upgrades/node_modules/unified/index.js:354:12)
Additional context
Please let me know if this should be moved to the other repo, as I noticed the error is coming from @storybook/mdx1-csf despite turning on the preview.
The text was updated successfully, but these errors were encountered:
Describe the bug
When importing both default and named exports into an mdx file, an error is produced, crashing the app. The app in question has
previewMdx2
set to true.To Reproduce
Steps to reproduce the behavior:
Expected behavior
I'm expecting this to work, as it's valid JS import syntax:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#syntax
Screenshots
Additional context
Please let me know if this should be moved to the other repo, as I noticed the error is coming from @storybook/mdx1-csf despite turning on the preview.
The text was updated successfully, but these errors were encountered: