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.

background-image css rule raises "Uncaught (in promise) Error: Cannot find module" in console

See original GitHub issue

Choose one: is this a ๐Ÿ› bug report or ๐Ÿ™‹ feature request? This is a ๐Ÿ› bug report.

๐ŸŽ› Configuration

Hereโ€™s the smallest reproducible configuration. No .babelrc, just 3 simple files: index.html - <link rel="stylesheet" href="index.css"> in head and <div>hi</div> in body. index.css - div { background: url("bg_diag.png"); } bg_diag.png - bg_diag.png

๐Ÿค” Expected Behavior

Clean console

๐Ÿ˜ฏ Current Behavior

http://localhost:1234/ seems okay (thereโ€™s a single network request and the page loads with that background-image for the div element). However, thereโ€™s an error in console:

Uncaught (in promise) Error: Cannot find module '6b40fa7fa533b048cde070004da2b0e1.png,4'
    at newRequire (css-loader.js:30)
    at newRequire (css-loader.js:22)
    at localRequire (css-loader.js:30)
    at css-loader.js:30
    at <anonymous>

๐ŸŒ Your Environment

"devDependencies": {
  "parcel-bundler": "^1.6.2"
}
Software Version(s)
Node v8.9.4
npm 5.6.0
Operating System Chrome on macOS

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:16
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
realdenniscommented, Mar 11, 2018

I just add import 'index.css'in entry js, and remove the <link rel="stylesheet" href="index.css"> to resolve this issue.

0reactions
github-actions[bot]commented, Jan 17, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Adding background image throws a module load error
When I add background-image: url(โ€ฆ/images/my-image.png) to phoenix.css, the image displays correctly but the console shows an error Uncaught ...
Read more >
Next.js background-image css property cant load the image
the image doesn't appear and no errors happened then, i tried to type in the browser website-url + the console.log results the image...
Read more >
How to fix CSS background-image not working | HTML/CSS
3. Explicitly set the element's width and/or height. ... If the image isn't showing up, but you aren't getting any 404 errors, go...
Read more >
Module not found: Error: Can't resolve file ยท Issue #4778 - GitHub
I tried that and it did compile with no errors, but then at runtime it was looking for 'assets' in the root of...
Read more >
css-loader - npm
Start using css-loader in your project by running `npm i css-loader`. ... (include resolve.modules ) and for alias , prefix it with a...
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