parcel build fails with "semantic.min.css:undefined:undefined: decl.moveTo is not a function"

Created on 4 Jan 2019  路  5Comments  路  Source: parcel-bundler/parcel

馃悰 bug report

I'm using Semantic-UI-React and the build fails. In dev, it's working fine.

In my index.js, I'm importing the Semantic CSS file as follow:

import 'semantic-ui-css/semantic.min.css'

馃帥 Configuration (.babelrc, package.json, cli command)

My .babelrc:

{
  "presets": ["env", "react"],
  "plugins": [
    "transform-object-rest-spread",
    "transform-class-properties",
    "react-hot-loader/babel"
  ]
}

馃 Expected Behavior

The build should not failed!

馃槸 Current Behavior

The build fails with this error:

脳  C:\Users\mapu\dev\my\ilapak-hmi-electron\node_modules\semantic-ui-css\semantic.min.css:undefined:undefined: decl.moveTo is not a function
    at C:\Users\mapu\dev\my\ilapak-hmi-electron\node_modules\semantic-ui-css\semantic.min.css:19:919
    at C:\Users\mapu\dev\my\ilapak-hmi-electron\node_modules\semantic-ui-css\semantic.min.css:19:928
    at C:\Users\mapu\dev\my\ilapak-hmi-electron\node_modules\postcss-merge-rules\dist\index.js:246:22
    at C:\Users\mapu\dev\my\ilapak-hmi-electron\node_modules\parcel-bundler\node_modules\postcss\lib\container.js:135:18
    at Rule.each (C:\Users\mapu\dev\my\ilapak-hmi-electron\node_modules\parcel-bundler\node_modules\postcss\lib\container.js:101:16)
    at Rule.walk (C:\Users\mapu\dev\my\ilapak-hmi-electron\node_modules\parcel-bundler\node_modules\postcss\lib\container.js:131:17)
    at C:\Users\mapu\dev\my\ilapak-hmi-electron\node_modules\postcss-merge-rules\dist\index.js:242:18
    at C:\Users\mapu\dev\my\ilapak-hmi-electron\node_modules\parcel-bundler\node_modules\postcss\lib\container.js:239:18
    at C:\Users\mapu\dev\my\ilapak-hmi-electron\node_modules\parcel-bundler\node_modules\postcss\lib\container.js:135:18
    at Root.each (C:\Users\mapu\dev\my\ilapak-hmi-electron\node_modules\parcel-bundler\node_modules\postcss\lib\container.js:101:16)
    at Root.walk (C:\Users\mapu\dev\my\ilapak-hmi-electron\node_modules\parcel-bundler\node_modules\postcss\lib\container.js:131:17)
    at Root.walkRules (C:\Users\mapu\dev\my\ilapak-hmi-electron\node_modules\parcel-bundler\node_modules\postcss\lib\container.js:237:19)

馃拋 Possible Solution

A downgrade of Semantic-UI or Parcel(?)

馃敠 Context

I'm importing Sementic-UI-CSS as described in Sementic-UI documentation

馃捇 Code Sample

import 'semantic-ui-css/semantic.min.css'

馃實 Your Environment

| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.11.0
| Node | 10.14.0
| npm/Yarn | 6.4.1
| Operating System | Windows 10
| Sementic-UI | 0.84.0

Bug

Most helpful comment

The latest htmlnano (0.2.2) uses the same cssnano (^4.1.8) of parcel-bundler. So, an htmlnano upgrade to 0.2.2 should fix this issue.

All 5 comments

Might be a cssnano bug, does it work with --no-minify?

Yes, works with --no-minify. I guess it's a dep issue:

`-- [email protected]
  +-- [email protected]
  | `-- [email protected]
  |   `-- [email protected]
  `-- [email protected]
    `-- [email protected]
      `-- [email protected]

[email protected] uses an old version of postcss-merge-rules.

@devmao would be great if you could experiment a little and update the htmlnano dep manually to test it.

The latest htmlnano (0.2.2) uses the same cssnano (^4.1.8) of parcel-bundler. So, an htmlnano upgrade to 0.2.2 should fix this issue.

@devmao Was this fixed by your PR?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jsftw86 picture jsftw86  路  3Comments

oliger picture oliger  路  3Comments

devongovett picture devongovett  路  3Comments

466023746 picture 466023746  路  3Comments

algebraic-brain picture algebraic-brain  路  3Comments