Parcel: ๐Ÿ› stylus image build error

Created on 26 Jan 2018  ยท  7Comments  ยท  Source: parcel-bundler/parcel

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 |

Bug Confirmed Bug CSS Preprocessing

Most helpful comment

me too having a similar issue.

All 7 comments

me too having a similar issue.

Same error

@aicest Youโ€™ve done some work with Stylus before. Do you think you can try looking into this?

any progress on this? can we help?

@DakshMiglani Ya sure! Feel free to submit a PR ๐Ÿ˜ƒ

Alright I'll check on that, also the same bug is with sass.

540

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dsky1990 picture dsky1990  ยท  3Comments

humphd picture humphd  ยท  3Comments

philipodev picture philipodev  ยท  3Comments

oliger picture oliger  ยท  3Comments

Niggler picture Niggler  ยท  3Comments