question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Avatar MDX file not included in build

See original GitHub issue

I noticed that when the design system is built, it leaves the Avatar.stories.mdx file out of the build. This leaves this component out of the UI of the app.

This seems to be the case in the screenshot in the Distribute docs as well: example-app-storybook-with-design-system-stories

How do we go about getting the mdx file included in the build?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
jonniebigodescommented, Jan 31, 2020

@stephyswe i’ve skimmed through the existing documentation and it seems that there are still some lingering issues, as it’s not accurate, there are some things that need to be addressed as with the recent release of 5.3 with new configuration available. It’s my belief that the team behind Storybook focused on the development and release of the said version to make not only the configuration more approachable, leaner and simpler to use. And the documentation would be rolled out incrementally as soon as all items are vetted to avoid misleading the readers. I think that this is going to be fixed shortly.

1reaction
tmeasdaycommented, Feb 4, 2020

@domyen, yes right now we transpile the .stories.js files and place them inside the package that is published to npm. This allows consumers to import those stories without needing to share babel configs etc with the author of the npm package.

So far so good. But when it comes to mdx, there is no babel plugin you can use to compile it to ES5, as the storybook mdx loader has a bunch of smarts that run at load time. So we’d have to ship them in the npm package unmodified, which would then mean if someone was to import them they’d have to have a similar webpack/babel setup to the package author. It might work in a lot of cases but it would be seriously confusing when it didn’t.

This will be fixed with the composition feature which uses a different approach that avoids these problems.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript show error for .mdx extension file in nextjs
Show activity on this post. To resolve this, create a file called mdx. d. ts in root of your project and paste the...
Read more >
Live Edit or enabling Controls in MDX format #13477 - GitHub
Hi All,. Is there a way to make Live edit or enable Control addon in the MDX format? I have noticed that in...
Read more >
How I Built my Blog using MDX, Next.js, and React
Collect all of the MDX files in the pages directory, using fs. readdirSync . Load the frontmatter (I use an NPM package for...
Read more >
How to Source MDX Content in Next.js to Dynamically Create ...
js MDX Remote. Try considering your use case. You may not run into any issues if you're running a small personal project like...
Read more >
Create a Next.js and MDX blog - LogRocket Blog
Learn how to build a blog in Next.js using MDX to allow for the creation of interactive content, along with adding styles and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found