vite-plugin-svgr icon indicating copy to clipboard operation
vite-plugin-svgr copied to clipboard

[Error] Using external stories

Open brumasribera opened this issue 1 year ago • 3 comments

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!

brumasribera avatar Oct 06 '22 10:10 brumasribera

same problem

BLOCKMATERIAL avatar Feb 17 '23 11:02 BLOCKMATERIAL

@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

hrytsiukpavlo avatar Feb 17 '23 12:02 hrytsiukpavlo

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

yeap, it's works fine

BLOCKMATERIAL avatar Feb 17 '23 12:02 BLOCKMATERIAL