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

Inquiries about applying the addon. #15

Open
H0onnn opened this issue May 24, 2024 · 5 comments
Open

Inquiries about applying the addon. #15

H0onnn opened this issue May 24, 2024 · 5 comments

Comments

@H0onnn
Copy link

H0onnn commented May 24, 2024

Hello, I am trying to apply this addon to an open source project called recharts.

I went through the process below, but an error is occurring.

process

  1. npm i @codesandbox/storybook-addon --save-dev
  2. Add @codesandbox/storybook-addon to storybook/main.ts
  3. Add parameters to storybook/preview.ts
// import ...

const preview: Preview = {
  parameters: {
    // ...
   // add codesandbox parameters
    codesandbox: {
      apiToken: '123_12_1234',
      dependencies: {
        react: 'latest',
        'react-dom': 'latest',
        recharts: 'latest',
      },
      fallbackImport: {},
    },
  },
};

export default preview;

error message

image

I couldn't find a solution due to lack of references.

Any help would be greatly appreciated.

@danilowoz
Copy link
Member

Hi, thanks for opening this issue.

Could you please share a screenshot from your console? Maybe we can find some additional information from there. Plus, I'd try to remove fallbackImport from your configuration.

@H0onnn
Copy link
Author

H0onnn commented May 27, 2024

Hello, @danilowoz Thank you for the reply !

Below is the console log.

image

Is the apiToken wrong? It has the same format as 123_12_1234 and consists of a total of 9 characters excluding '_'.

@danilowoz
Copy link
Member

danilowoz commented May 27, 2024

Your token should be following strucutre: csb_v1_xxxx_xxxx-xxxx-xxxx. Maybe you're using team-id instead of the API token?

@H0onnn
Copy link
Author

H0onnn commented May 27, 2024

@danilowoz

It seems that all apiTokens are not displayed because I am an invited general member. I'll have to ask the recharts team about this.

@H0onnn
Copy link
Author

H0onnn commented May 30, 2024

Hello, @danilowoz !

If I add fallbackImport: 'recharts',

To indicate that all components should be imported from recharts we get something like that sandbox where it imports CategoricalChart instead of the correct AreaChart, etc.

This means that we need an Import map in the meta of each story ?

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

2 participants