Skip to content

Commit

Permalink
Addon-docs: Fix mdx loading error
Browse files Browse the repository at this point in the history
  • Loading branch information
shilman committed Jun 22, 2019
1 parent 8f2f3e5 commit 75cb841
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/official-storybook/stories/addon-docs.stories.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import notes from './notes/notes.md';
import mdxNotes from './notes/notes.stories.mdx';
import mdxNotes from './notes/notes.mdx';
import DocgenButton from '../components/DocgenButton';

export default {
Expand All @@ -27,7 +27,7 @@ withInfo.parameters = {
export const mdxOverride = () => <div>Click docs tab to see MDX-overridden docs</div>;
mdxOverride.title = 'mdx override';
mdxOverride.parameters = {
docs: mdxNotes && mdxNotes.parameters && mdxNotes.parameters.docs,
docs: mdxNotes,
};

export const jsxOverride = () => <div>Click docs tab to see JSX-overridden docs</div>;
Expand Down
4 changes: 3 additions & 1 deletion lib/core/src/client/preview/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ export default function start(render, { decorateStory } = {}) {

if (!fileExports.default.title) {
throw new Error(
`Unexpected default export without title: ${JSON.stringify(fileExports.default)}`
`Unexpected default export without title in '${filename}': ${JSON.stringify(
fileExports.default
)}`
);
}

Expand Down

0 comments on commit 75cb841

Please sign in to comment.