cannot refer url file in public folder using '/'
Cannot resolve file path in public folder such that
background-image: url(/images/icon.svg);
The icon.svg is in public/images the error display as below
Error: Can't resolve 'src/images/icon.svg'
Cannot resolve file path in public folder such that
background-image: url(/images/icon.svg);
The icon.svg is in public/images the error display as below
Error: Can't resolve 'src/images/icon.svg'
I think you can try moving icon.svg to src/images/
put the icon.svg file into public/images folder and refer to it via <img src="images/icon.svg"/> or background: url("images/icon.svg") I didn't see quotes in your url example above.
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.
I'm facing similar issue.
I have one jpg image in my project, which is located at '/public/images/sample.jpg'.
After running npm start, it appeared at 'http://127.0.0.1:3000/static/media/sample.21161eecaa099ee42c7a.jpg'.
Currently there's no way I can reference this image in my tsx file.