-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot find module when import svg #217
Comments
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: #103 (comment) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?
The text was updated successfully, but these errors were encountered: