Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDX transformation fails #13

Closed
sveisvei opened this issue Apr 28, 2021 · 6 comments
Closed

MDX transformation fails #13

sveisvei opened this issue Apr 28, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@sveisvei
Copy link

sveisvei commented Apr 28, 2021

Running the code in the readme and then building the static version does not work out of the box.

Does output "unexpected" large output as well.

Skjermbilde 2021-04-28 kl  19 16 42

vs without the mdx file:

Skjermbilde 2021-04-28 kl  19 19 11

@eirslett
Copy link
Collaborator

Takk for sist! 😃

Is this with the latest version of Storybook (6.3-alpha-something) and the latest version of the builder? What about it is not working? MDX should at least work in development mode, I haven't checked the static build yet.

I agree that the file sizes look pretty huge. Maybe the addon-docs component itself is pretty heavy? We should compare the numbers to the Webpack version, I'm not sure if the large bundle size is Vite's fault or not.

@sveisvei
Copy link
Author

Takk for sist ja, tiden flyr :)!

It was just an observation, I have not checked what the expected size is yet - will check this soon.

@lmestel
Copy link

lmestel commented Jun 17, 2021

Hi,

running the react example with a MDX story results in an empty Docs page and Uncaught TypeError: Cannot read property 'fromId' of undefined. Canvas looks good.

Bildschirmfoto 2021-06-17 um 12 39 12

Here is a repo to reproduce: https://github.com/lmestel/storybook-builder-vite (with a Button.stories.mdx in the example-react package)

@shilman shilman added the bug Something isn't working label Jun 17, 2021
@eirslett
Copy link
Collaborator

eirslett commented Jun 17, 2021

I wonder if this could be related to Typescript-docgen-plugin or something like that? It's still missing in the Vite builder... (nobody has implemented it yet)

@shilman
Copy link
Member

shilman commented Jun 17, 2021

There is code in the preview that sets up a react context called DocsContext with a storyStore, and somehow that isn't getting set properly in the vite-builder:

https://github.com/storybookjs/storybook/blob/next/lib/core-client/src/preview/StoryRenderer.tsx#L320

Unrelated to react-docgen-typescript-plugin AFAIK. Also we are thinking about getting rid of that and taking a different approach that is builder-agnostic -- not sure about the timeline on that though. cc @bebraw

@eirslett
Copy link
Collaborator

eirslett commented Jul 8, 2021

This should be fixed in the latest release (with Storybook 6.3.4 or newer)

@eirslett eirslett closed this as completed Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants