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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: TypeError: decl.moveTo is not a function #151

Open
sbrl opened this issue Jan 17, 2019 · 0 comments
Open

Error: TypeError: decl.moveTo is not a function #151

sbrl opened this issue Jan 17, 2019 · 0 comments

Comments

@sbrl
Copy link

sbrl commented Jan 17, 2019

I'm looking into using cssnano via rollup-plugin-postcss, with the minimize: true option, but I'm encountering an error whenever I try to use it:

[!] (postcss plugin) TypeError: decl.moveTo is not a function
client_src/css/main.css
TypeError: decl.moveTo is not a function
    at path/to/project/node_modules/leaflet/dist/leaflet.css:188:10
    at path/to/project/node_modules/cssnano/node_modules/postcss-merge-rules/dist/index.js:246:22
    at path/to/project/node_modules/postcss-import/node_modules/postcss/lib/container.js:135:18
    at Rule.each (path/to/project/node_modules/postcss-import/node_modules/postcss/lib/container.js:101:16)
    at Rule.walk (path/to/project/node_modules/postcss-import/node_modules/postcss/lib/container.js:131:17)
    at path/to/project/node_modules/cssnano/node_modules/postcss-merge-rules/dist/index.js:242:18
    at path/to/project/node_modules/postcss/lib/container.js:237:28
    at path/to/project/node_modules/postcss/lib/container.js:144:26
    at Root.each (path/to/project/node_modules/postcss/lib/container.js:110:22)
    at Root.walk (path/to/project/node_modules/postcss/lib/container.js:143:21)
    at Root.walkRules (path/to/project/node_modules/postcss/lib/container.js:235:25)

After a bunch of digging, it transpired that the issue was with postcss-merge-rules, which was reported and fixed in ben-eb/postcss-merge-rules#52. Confused, I turned to npm-why to figure out what was going wrong. It turns out that cssnano is still depending on version 2.1.2 of postcss-merge-rules - even though the latest version is 4.0.2!

$ npm-why postcss-merge-rules

  Who required postcss-merge-rules:

  my-project > rollup-plugin-postcss > cssnano > postcss-merge-rules@2.1.2

However, there's an additional twist in the tale. Upon reporting this to the cssnano project in cssnano/cssnano#676, I discovered that the issue wasn't with cssnano at all - it's with this plugin (rollup-plugin-postcss) - which is depending on an ancient version of cssnano.

Could cssnano be updated please? I'd like very much to be able to minimise my css, but I can't do so currently :-/

More information is, of course, available upon request.

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

No branches or pull requests

1 participant