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

Missing "./dist/doc-blocks" specifier in "storybook-design-token" package? #202

Open
fglendrange opened this issue Dec 19, 2023 · 2 comments

Comments

@fglendrange
Copy link

I seem to be running into an issue when trying to use the DocBlock for the design tokens as described in these instances:
https://github.com/UX-and-I/storybook-design-token/blob/v1/demo/src/design-tokens/colors.stories.mdx
https://storybook.js.org/addons/storybook-design-token
https://github.com/UX-and-I/storybook-design-token/blob/v3/addon/src/stories/Introduction.mdx

I am runing v3. Is there any e.g. Vite specific things I would need to incorporate?

Eg 1:

import { Meta, Story, Canvas } from '@storybook/addon-docs';
import { DesignTokenDocBlock } from 'storybook-design-token/dist/doc-blocks';

<Meta title="Design Tokens/Colors" />

# Colors

Lorem ipsum dolor sit amet consectetur, adipisicing elit. Pariatur qui ut
beatae nam molestiae cum doloremque fugit nihil, vitae modi recusandae culpa
odit facere eum vel reiciendis eius repellat, totam aperiam. Molestiae error
voluptatibus et neque vel libero, harum nam quibusdam mollitia, sapiente rerum
iste modi sit deserunt? Officiis, quaerat!

<DesignTokenDocBlock categoryName="Colors" />

## As cards

<DesignTokenDocBlock categoryName="Colors" viewType="card" />

Error in terminal:

[vite] Internal server error: Missing "./dist/doc-blocks" specifier in "storybook-design-token" package

Error in browser:

Failed to fetch dynamically imported module: http://localhost:6006/.storybook/Tokens/colors.stories.mdx
@pawelpukszta
Copy link

Hi @fglendrange,

Do these errors also occur when the import path in the colors.stories.mdx file is like this?:
import { DesignTokenDocBlock } from 'storybook-design-token'

@gleissonneves
Copy link

gleissonneves commented Aug 9, 2024

This worked perfectly for me.

my version storybook is: ^8.3.0-alpha.3

I saw that in the main readme, we already have this documentation. It is likely that in parallel sites it is out of date

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants