Skip to content
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

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

Closed
devmao opened this issue Jan 4, 2019 · 15 comments

Comments

@devmao
Copy link
Contributor

devmao commented Jan 4, 2019

馃悰 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
@DeMoorJasper
Copy link
Member

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

@devmao
Copy link
Contributor Author

devmao commented Jan 4, 2019

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

`-- parcel-bundler@1.11.0
  +-- cssnano@4.1.8
  | `-- cssnano-preset-default@4.0.6
  |   `-- postcss-merge-rules@4.0.2
  `-- htmlnano@0.1.10
    `-- cssnano@3.10.0
      `-- postcss-merge-rules@2.1.2

htmlnano@0.1.10 uses an old version of postcss-merge-rules.

@DeMoorJasper
Copy link
Member

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

@devmao
Copy link
Contributor Author

devmao commented Jan 4, 2019

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 devmao mentioned this issue Jan 4, 2019
3 tasks
@mischnic
Copy link
Member

mischnic commented Jan 4, 2019

@devmao Was this fixed by your PR?

@JAicewizard
Copy link

This still happens using parcel-bundler 1.12.5. Even with an empty css file.

inde.html:

<!DOCTYPE html><html lang="en"><link rel="stylesheet" href="style.css" /></html>

style.css:


@KokoDoko
Copy link

Still the same problem here. I can fix it only by using --no-minify

@AlexMelw
Copy link

AlexMelw commented Jun 2, 2021

Still the same problem here. I can fix it only by using --no-minify

That helped as a quick temporary solution. But that's a hack. We do need minification for production.

@jedgar1mx
Copy link

Yes, I'm having the same issue.

@aaroncrawford
Copy link

aaroncrawford commented Jun 10, 2021

@AlexMelw @jedgar1mx

Was getting the same issue with parcel 1.12.5 and cssnano v5. Downgraded cssnano to 4.1.11 and it started building.

npm uninstall cssnano
npm i -D cssnano@4.1.11

Not sure if it will fix anyone else's issue, but worked for us.

@Daemoneq
Copy link

I lov u bro it works for me

@AlexMelw
Copy link

AlexMelw commented Jun 14, 2021

@AlexMelw @jedgar1mx

Was getting the same issue with parcel 1.12.5 and cssnano v5. Downgraded cssnano to 4.1.11 and it started building.

npm uninstall cssnano
npm i -D cssnano@4.1.11

Not sure if it will fix anyone else's issue, but worked for us.

Where did you run those commands?
Inside your current work project or inside the Parcel project?

@aaroncrawford
Copy link

Run those commands wherever your package.json file is

@jackie1santana
Copy link

npm uninstall cssnano
npm i -D cssnano@4.1.11

thank you it worked

@kianbabai
Copy link

kianbabai commented Oct 29, 2022

@AlexMelw @jedgar1mx

Was getting the same issue with parcel 1.12.5 and cssnano v5. Downgraded cssnano to 4.1.11 and it started building.

npm uninstall cssnano npm i -D cssnano@4.1.11

Not sure if it will fix anyone else's issue, but worked for us.

Thank you.

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

No branches or pull requests

12 participants