Replies: 3 comments
-
Hey @elramus Are you using jest or vitest? |
Beta Was this translation helpful? Give feedback.
-
Thanks for the fast response @gilbarbara. I did verify that For some additional context, up until now we've been on Create React App 4, React 17, and react-inlinesvg 2.2.2, with vitest for test runner. We're in the process of switching over to Vite + React 18. Would like to do latest react-inlinesvg as well, but this issue is blocking that part at the moment. Version 2.2.2 continues to work fine in the new Vite + React 18. |
Beta Was this translation helpful? Give feedback.
-
But aside from the tests, does the latest version work with your app? Can you try to edit the |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
When rendering the
SVG
component in arender
function fromtesting-library/react
, the SVG does not render and itsonError
function fires, saying:Your minimal, reproducible example
Can't make sandbox cause it happens when running tests via command line
Steps to reproduce
Not quite sure how to put this into a sandbox since it happens when running a test via command line, but you can reproduce by creating a new, clean Vite React TS project, adding vitest and react testing library, and making a simple test to try and render it.
Expected behavior
Render the SVG the same as it does when not testing
How often does this bug happen?
Every time
Screenshots or Videos
Platform
Mac OS, Sanoma 14.2, M2 chip
react-inlinesvg version
4.1.0
TypeScript version
5.2.2
Build tool
Vite
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions