0

Hi I'm currently learning storybook and ran into this error when trying to setup.

I'm doing this in .mdx file and heres my code so far

import { Meta, Story } from '@storybook/addon-docs';

import { EyebrowAmountComponent } from './eyebrow-amount.component';

<Meta title="EyebrowAmount" component={EyebrowAmountComponent}/>

<Story name="Primary">
  {{
    props: {
        eyebrow: "eyebrow title",
        amount: "$12"
    },
  }}
</Story>

enter image description here

I tried googling but nothing similar came up. Can someone help me understand what I'm doing wrong much appreciated.

Jonas Chan
  • 49
  • 1
  • 5

2 Answers2

0

Okay I figured out what the issue was. What I did wrong was I did not import all the necessary component and module to render my component in storybook. So make sure you provide all the right declarations and imports for storybook.

Jonas Chan
  • 49
  • 1
  • 5
0

What I did wrong was unintentionally importing the Module / InjectionToken from the relative path to a project that is a package. I changed the import to the package (@...) using the public API and the error was gone.

Marlene
  • 31
  • 4