Skip to content
Advertisement

Importing SVG in NextJS

I am trying to import an svg within a NextJS project, everytime I get this error

JavaScript

I have tried using next-images and also svgr. I will paste my About.js code below, it would be excellent if someone could let me know what I have been doing wrong.

JavaScript

Advertisement

Answer

Using next-images and adding the correct module exports allowed me to use images of all file types.

https://www.npmjs.com/package/next-images

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement