New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 stylus image build error #673

Open
ZZ-Zero opened this Issue Jan 26, 2018 · 7 comments

Comments

Projects
None yet
5 participants
@ZZ-Zero

ZZ-Zero commented Jan 26, 2018

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

@ZZ-Zero ZZ-Zero changed the title from stylus image build error to stylus image build error #bug Jan 26, 2018

@ZZ-Zero ZZ-Zero changed the title from stylus image build error #bug to stylus image build error Jan 26, 2018

@DakshMiglani

This comment has been minimized.

DakshMiglani commented Jan 26, 2018

me too having a similar issue.

@adityamandal

This comment has been minimized.

adityamandal commented Jan 26, 2018

Same error

@davidnagli

This comment has been minimized.

Member

davidnagli commented Jan 26, 2018

@aicest You鈥檝e done some work with Stylus before. Do you think you can try looking into this?

@davidnagli davidnagli changed the title from stylus image build error to 馃悰 stylus image build error Jan 26, 2018

@DakshMiglani

This comment has been minimized.

DakshMiglani commented Jan 27, 2018

any progress on this? can we help?

@davidnagli

This comment has been minimized.

Member

davidnagli commented Jan 27, 2018

@DakshMiglani Ya sure! Feel free to submit a PR 馃槂

@DakshMiglani

This comment has been minimized.

DakshMiglani commented Jan 28, 2018

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

@DakshMiglani

This comment has been minimized.

DakshMiglani commented Jan 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment