question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Cannot find module 'logo.png'

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
moshestcommented, May 23, 2017

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.

1reaction
ucaycommented, May 23, 2017

is this related with webpack’s issue? https://github.com/webpack-contrib/css-loader/issues/74

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found