How to test Next.js app with svg imports as component using vitest?

How to test Next.js app with svg imports as component using vitest?

Mar 12 ’23
Comments: 1
Answers: 0


This content originally appeared on DEV Community and was authored by Mayank

I use vitest to test Next.js app following the official example here.

I get error saying 'InvalidCharacterError: "../../company-logo.svg" did not match the Name production'. Finally I figured out that the image was because of svg imported as components. When I removed svg imports as components, it worked fine.

I…


This content originally appeared on DEV Community and was authored by Mayank


Print Share Comment Cite Upload Translate Updates
APA

Mayank | Sciencx (2023-03-12T15:49:52+00:00) How to test Next.js app with svg imports as component using vitest?. Retrieved from https://www.scien.cx/2023/03/12/how-to-test-next-js-app-with-svg-imports-as-component-using-vitest/

MLA
" » How to test Next.js app with svg imports as component using vitest?." Mayank | Sciencx - Sunday March 12, 2023, https://www.scien.cx/2023/03/12/how-to-test-next-js-app-with-svg-imports-as-component-using-vitest/
HARVARD
Mayank | Sciencx Sunday March 12, 2023 » How to test Next.js app with svg imports as component using vitest?., viewed ,<https://www.scien.cx/2023/03/12/how-to-test-next-js-app-with-svg-imports-as-component-using-vitest/>
VANCOUVER
Mayank | Sciencx - » How to test Next.js app with svg imports as component using vitest?. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2023/03/12/how-to-test-next-js-app-with-svg-imports-as-component-using-vitest/
CHICAGO
" » How to test Next.js app with svg imports as component using vitest?." Mayank | Sciencx - Accessed . https://www.scien.cx/2023/03/12/how-to-test-next-js-app-with-svg-imports-as-component-using-vitest/
IEEE
" » How to test Next.js app with svg imports as component using vitest?." Mayank | Sciencx [Online]. Available: https://www.scien.cx/2023/03/12/how-to-test-next-js-app-with-svg-imports-as-component-using-vitest/. [Accessed: ]
rf:citation
» How to test Next.js app with svg imports as component using vitest? | Mayank | Sciencx | https://www.scien.cx/2023/03/12/how-to-test-next-js-app-with-svg-imports-as-component-using-vitest/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.