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

Addon tab not shown in Storybook 7.0.0-alpha.46 #172

Closed
7 of 11 tasks
interphased opened this issue Nov 3, 2022 · 4 comments
Closed
7 of 11 tasks

Addon tab not shown in Storybook 7.0.0-alpha.46 #172

interphased opened this issue Nov 3, 2022 · 4 comments
Labels
category: bug Something isn't working

Comments

@interphased
Copy link
Contributor

Affected design types

  • figma
  • figspec
  • link
  • image
  • iframe

Describe the bug

I'm still having this issue in Storybook 7.0.0-alpha.46 and storybook-addon-designs 7.0.0-beta.0.

index.js:10 Uncaught TypeError: addons_default.register is not a function
    at register (index.js:10:12)
    at register.js:3:1

If I update the addons import in src/register/index.tsx like so:

- import addons, { types } from "@storybook/addons";
+ import { addons, types } from "@storybook/addons";

The problem goes away, and now the tab appears in Storybook, but then I get other issues:

image

Strangely, if I find the iframe src and view it in a new tab it shows up. Maybe that's a separate issue with Figma and localhost permissions.

How to reproduce the bug?

See this issue.

Note that I'm using @storybook/react-vite framework:

// main.cjs

module.exports = {
  stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
  addons: [
    ...
    'storybook-addon-designs',
  ],
  framework: {
    name: '@storybook/react-vite',
    options: {},
  },
  core: {},
  staticDirs: ['../public'],
  async viteFinal(config) {
    return mergeConfig(config, {
      resolve: {
        alias: {
          '@': path.resolve(__dirname, '../src'),
        },
      },
    });
  },
};

Expected behaviour

To show the design tab.

Environment

  • Chrome / Chromium / Chromium based browsers
  • Firefox
  • macOS Safari
  • iOS Safari
  • Samsung Internet
  • Other

Affected versions

7.0.0-beta.0

Storybook versions

7.0.0-alpha.46

@interphased interphased added the category: bug Something isn't working label Nov 3, 2022
@pocka
Copy link
Collaborator

pocka commented Nov 4, 2022

If I update the addons import in src/register/index.tsx like so:

You're right. That file didn't get the update in #160... This should be an easy fix.

Strangely, if I find the iframe src and view it in a new tab it shows up. Maybe that's a separate issue with Figma and localhost permissions.

Yes, the addon is working okay when logs from mobile_viewer.min.js.br appears in a browser console.
I'm not sure what the WS warning (the first one) is, but you can safely ignore the source map warnings (the last two).

@interphased
Copy link
Contributor Author

Ok great. I've added a PR.

@pocka
Copy link
Collaborator

pocka commented Nov 5, 2022

Fixed by #173.

@pocka pocka closed this as completed Nov 5, 2022
@mnik01
Copy link

mnik01 commented Apr 1, 2023

facing this issue in version "storybook-addon-designs": "7.0.0-alpha.3",
what i need to do?

UPD: my bad. Fix was introduced in PR above.
So i just updated to 7.0.0-beta.2 and bug gone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants