DEV Community

Mayank
Mayank

Posted on

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

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…

Top comments (0)