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

[Error] Using external stories #54

Open
brumasribera opened this issue Oct 6, 2022 · 3 comments
Open

[Error] Using external stories #54

brumasribera opened this issue Oct 6, 2022 · 3 comments

Comments

@brumasribera
Copy link

brumasribera commented Oct 6, 2022

Hi there! So, I am using Lerna and fetching stories from different packages to my Storybook Vite package.

I import your extension on the vite.config.ts as described in the docs and I get the following error:

SyntaxError: The requested module '/@fs/C:/[...]/icon.svg?import' does not provide an export named 'ReactComponent'

I tried setting an included with the path of the file:

plugins: [react(), svgr({include: '../[...]/add-round.svg'})]

But still gives the same error.

I would really appreciate any help!

@BLOCKMATERIAL
Copy link

same problem

@hrytsiukpavlo
Copy link

@brumasribera check out this article, paragraph 6. It helped me.
But also be careful with options, svgrOptions: { icon: true, } made my icons look smaller then they really are.

https://blog.devgenius.io/react-vite-tailwind-css-twin-macro-storybook-svg-imports-as-react-component-6b44d5e2641

@BLOCKMATERIAL
Copy link

But also be careful with options, svgrOptions: { icon: true, } made my icons look smaller then they really are.

yeap, it's works fine

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