vite-plugin-svgr
vite-plugin-svgr copied to clipboard
[Error] Using external stories
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!
same problem
@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
But also be careful with options, svgrOptions: { icon: true, } made my icons look smaller then they really are.
yeap, it's works fine