Error: Cannot find module 'logo.png'
See original GitHub issueI have a component Logo
with Logo.css
and logo.png
files.
When I use the image on the css file like:
.root {
background: url('logo.png') no-repeat 0 0;
}
I got the following error: Error: Cannot find module 'logo.png'
If I change the path to url('/logo.png')
and put the logo image on the public
folder, everything works fine but that’s breaks the component-based UI development principle.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:6
- Comments:9 (2 by maintainers)
Top Results From Across the Web
44 - Stack Overflow
TS2307 : Cannot find module './images/logo.png'. All my other modules are importing just fine, ie; my css, svg and ts files. It only...
Read more >Cannot find module error when importing an static file ...
But when I use typescript I get this error on the vscode console. Cannot find module '@client/assets/img/character.png'.
Read more >Add images to a React project with Typescript - Medium
Cannot find module './../assets/images/logo.png'. The first time I saw that error, I thought “It's a bug!”, but after searching and understanding typescript ...
Read more >Error "Cannot find module 'react' or its corresponding type ...
I am working on an 1.14 SPFX web part, but inside the .ts file we are getting reference errors on almost all the...
Read more >appsloveworld-logo
[Solved]-Cannot find module '../../images/Logo.png'.ts(2307) Red Error is Still showing-Reactjs. Search. score:1. This happens mainly because typescript ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes. Looks like it’s the same issue.
Disabling the
modules: true
on css-loader options break all the images on the website but the warning gone.is this related with webpack’s issue? https://github.com/webpack-contrib/css-loader/issues/74