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

mayank1513

Mayank

Posted on March 12, 2023

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…

💖 💪 🙅 🚩
mayank1513
Mayank

Posted on March 12, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related