toJSX does not have a default for `options.file`
See original GitHub issueSubject of the issue
After the most recent release, Storybook will not build and returns this error:
WARN ./src/components/Box/Box.stories.mdx
WARN Module build failed (from ./node_modules/@mdx-js/loader/index.js):
WARN TypeError: Cannot read property 'path' of undefined
WARN at Function.toJSX (project/node_modules/@storybook/addon-docs/node_modules/@mdx-js/mdx/mdx-hast-to-jsx.js:124:30)
WARN at extractExports (project/node_modules/@storybook/addon-docs/dist/mdx/mdx-compiler-plugin.js:396:29)
WARN at Compiler (project/node_modules/@storybook/addon-docs/dist/mdx/mdx-compiler-plugin.js:454:14)
WARN at Function.stringify (project/node_modules/unified/index.js:354:12)
WARN at pipelineStringify (project/node_modules/unified/index.js:41:18)
WARN at wrapped (project/node_modules/trough/wrap.js:25:19)
WARN at next (project/node_modules/trough/index.js:57:24)
WARN at done (project/node_modules/trough/wrap.js:55:16)
WARN at done (project/node_modules/unified/index.js:35:7)
WARN at done (project/node_modules/unified/index.js:314:11)
WARN at next (project/node_modules/trough/index.js:59:14)
WARN at done (project/node_modules/trough/wrap.js:55:16)
WARN at then (project/node_modules/trough/wrap.js:62:5)
WARN at wrapped (project/node_modules/trough/wrap.js:45:9)
WARN at next (project/node_modules/trough/index.js:57:24)
WARN at done (project/node_modules/trough/wrap.js:55:16)
WARN @ ./src/components/Box sync nonrecursive ^\.\/(?:(?:Box\.stories\.mdx)$)$ ./Box.stories.mdx
WARN @ ./.storybook/generated-entry.js
WARN @ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./node_modules/@storybook/addon-docs/dist/frameworks/common/config.js ./node_modules/@storybook/addon-docs/dist/frameworks/react/config.js ./.storybook/preview.js ./.storybook/generated-entry.js
This might be Storybook’s issue to solve, but it also seems as if there isn’t a defaulting occurring for options.file
inside of toJSX()
here, which was introduced in #1126.
Your environment
- OS: OSX 10.15.5
- Packages:
@storybook/addon-docs ^5.3.13
,@storybook/react ^5.3.13
- Env: lerna + yarn
Steps to reproduce
- Have a
.stories.mdx
file in a storybook build - execute the
build-storybook
script that Storybook ships with
Expected behaviour
Storybook builds
Actual behaviour
Storybook fails building with the above error
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:29 (14 by maintainers)
Top Results From Across the Web
React JSX: selecting “selected” on selected <select> option ...
React JSX: selecting “selected” on selected <select> option with default option have issues · But I'm facing issues with setting defaultValue .
Read more >Documentation - JSX - TypeScript
json file. *Note: You can specify the JSX factory function to use when targeting react JSX emit with jsxFactory option (defaults to React....
Read more >Strict Mode - React
StrictMode is a tool for highlighting potential problems in an application. Like Fragment , StrictMode does not render any visible UI.
Read more >Complete Guide to Webpack Configuration for React
Each rule can have a test property that tests if a file should be acted upon by webpack. In our case we'll want...
Read more >react-native-fs - npm
Done! No need to worry about manually adding the library to your project. ... isFile()) { // if we have a file, read...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Released
1.6.11
🚀Same here! Thanks for your help everyone!