Open ka8725 opened 3 years ago
I also get this error. When I require svg in my src/*.tsx files it works in dev mode, but when I build (run next build) it fails with the following error:
Cannot find module '../../../public/plus.svg?sprite'.
Did you do specific configuration to use the library on typescript ? It's not work for me even in dev mode
this should help you out: https://github.com/cyrilwanner/next-optimized-images/issues/103#issuecomment-554326426
My application folders structure is the following:
Svg icons live in
public/images
folder as per next.js convention.Webpack config is the following:
(
imagemin-svgo
andsvg-sprite-loader
are installed).When I require svg in my
src/*.tsx
files it works in dev mode, but when I build (runnext build
) it fails with the following error:What am I doing wrong?