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.

๐Ÿ› stylus image build error

See original GitHub issue

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

๐ŸŽ› Configuration package.json

  "scripts": {
    "start": "rimraf ./dist && parcel ./src/index.html",
    "build": "rimraf ./dist && parcel build ./src/index.html"
  },
  "devDependencies": {
    "babel-polyfill": "^6.26.0",
    "babel-preset-env": "^1.6.1",
    "rimraf": "^2.6.2",
    "stylus": "^0.54.5"
  }

๐Ÿค” Expected Behavior

Itโ€™s work

๐Ÿ˜ฏ Current Behavior

parcel ./src/index.html --no-cache
Server running at http://localhost:1234
โœจ  Built in 3.15s.

In dist, all background-image is

background-image: url("6ca929a9fe71b45e369a3d439a90e58e.");

not find this img file

In browser console

css-loader.js:31 Uncaught (in promise) Error: Cannot find module '54cb5b99c362480e7d815a6feae6722f.png,20'
    at newRequire (css-loader.js:31)
    at newRequire (css-loader.js:22)
    at localRequire (css-loader.js:31)
    at css-loader.js:31
    at <anonymous>

๐Ÿ’ Possible Solution

๐Ÿ”ฆ Context

๐Ÿ’ป Code Sample

src
 | -- index.html
 | -- assets
      | -- img.jpg
      | -- common
             | -- xxx.jpg
             | -- xxx.jpg
             | -- xxx.jpg
 | -- style
      | -- index.styl
      | -- base.styl
      | -- common
             | -- xxx.styl
             | -- xxx.styl
             | -- xxx.styl

index.html

<!DOCTYPE html>
<html lang="zh">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <link rel="stylesheet" href="./style/index.styl">
</head>
<body>

  <script src="./script/index.js"></script>
</body>
</html>

index.styl

@import "./base.styl"

base.styl

// baseStyle
@import "./common/**"

./common/xxx.styl

  .icon
    width .28rem
    height .26rem
    background url('../../assets/common/icon-share.png') center no-repeat
    background-size 100% 100%

๐ŸŒ Your Environment

Software Version(s)
Parcel 1.5.1
Node v8.9.4
npm/Yarn npm 5.6.0
Operating System OS X

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
0xDakshcommented, Jan 26, 2018

me too having a similar issue.

1reaction
adityamandalcommented, Jan 26, 2018

Same error

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failing image build not reported to Docker client through ...
Building an image from an invalid Docker file using docker client through podman API service, should return an error code. Steps to reproduceย ......
Read more >
Enforcing Product Partition Interfaces
Build the device and look for build errors. ยท Resolve build errors and ensure that the device builds successfully. ยท Flash the image...
Read more >
Known issues in After Effects
Issue: After Effects crashes on launch or throws a "File is not found" error message when opening images with Camera Raw 13.0.
Read more >
Docker | WebStorm Documentation
Open the Dockerfile from which you want to build the image. ยท Click Run on Docker in the gutter and select to build...
Read more >
Rec Room - Play with friends! - Apps on Google Play
Rec Room is the place to build and play games together. Party up with friends from all around the world to chat, hang...
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