csscomb.js: TypeError: ast.remove is not a function

Sir, I’ve met this error with all CSS files and with both custom and default configure:

(node:25107) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: ast.remove is not a function
(node:25107) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

This error only occurs in v4.0.1, not with v3.1.7.

My environment:

node v7.7.1
arch linux 4.9.11

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 14
  • Comments: 23 (8 by maintainers)

Most upvoted comments

I am having the same issue and changing "eof-newline": false, to true fixes the fault. Hope that helps finding the issue.

Should this

https://github.com/csscomb/csscomb.js/blob/dev/src/options/block-indent.js#L48

ast.remove(i);

not be

ast.removeChild(i); ?

Is nobody maintaining this?

Fixed by @janwerkhoven with #552.

Also getting similar error. Node v.8.9.1 & OS High Sierra with latest CSSComb. (node:22596) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): [object Object] (node:22596) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Still having this issue in the current version until I make the change @ryanbowden suggested.

The fix from @mfeckie worked for me.

@janwerkhoven I do maintain this repository. I will look into this asap.

Temporary workaround: Remove "block-indent": " ", from the .csscomb.json file and the error ceases to appear and ceases to block the rest of the formatting. That means no indenting of blocks until fixed, but still better than no formatting at all.