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 not able to load images from local file paths #215

Closed
3 of 11 tasks
refugedesigns opened this issue Oct 9, 2023 · 1 comment
Closed
3 of 11 tasks

Addon not able to load images from local file paths #215

refugedesigns opened this issue Oct 9, 2023 · 1 comment
Labels
category: bug Something isn't working

Comments

@refugedesigns
Copy link

refugedesigns commented Oct 9, 2023

Affected design types

  • figma
  • figspec
  • link
  • image
  • iframe

Describe the bug

The configuration in the docs is for old version of addon-design https://storybookjs.github.io/addon-designs/?path=/story/docs-image-readme--page. However using the same configuration is not working in the latest version

How to reproduce the bug?

  1. npm install @storybook/addon-designs
  2. add "@storybook/addon-designs" to main.ts or main.js
  3. restart storybook
  4. import a local image eg. "import HeaderImage from '/path/to/image'"
  5. The image appear is broken in the design tab

Expected behaviour

The image should be visible in the design tab

Environment

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

Affected versions

7.0.5

Storybook versions

7.4.6

@refugedesigns refugedesigns added the category: bug Something isn't working label Oct 9, 2023
@pocka
Copy link
Collaborator

pocka commented Oct 17, 2023

Cannot reproduce with Storybook v7.4.6 (Vite builder) and Designs Addon v7.0.5.
Please attach a repro repo or code sandbox if it does not work with default configurations.

This addon does (should) not care about module format of non-JS files. A user is responsible to pass a valid URL to the addon. I don't know about webpack5 builder, but both Vite builder and webpack4 builder output an URL of the image file as a default export, hence the example.

@pocka pocka closed this as not planned Won't fix, can't repro, duplicate, stale Oct 17, 2023
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

2 participants