hudochenkov / postcss-sorting

PostCSS plugin to keep rules and at-rules content in order.
MIT License
517 stars 31 forks source link

Error when run with error `TypeError: Cannot read property 'includes' of undefined` #112

Closed miixel2 closed 3 weeks ago

miixel2 commented 1 year ago

Similar to #107 but error on another line of https://github.com/hudochenkov/postcss-sorting/blob/6027f1c376cbe78a2298bcca8e23f862457893c5/lib/isAllowedToProcess.js#L18

Command:

postcss src/tailwind.css -o src/tailwind.generated.css

Error I got:

TypeError: Cannot read property 'includes' of undefined
    at ...\src\tailwind.css:1:1
    at ...\src\tailwind.css:2:1
    at ...\node_modules\postcss-sorting\lib\isAllowedToProcess.js:18:49
    at Array.some (<anonymous>)
    at isAllowedToProcess (...\node_modules\postcss-sorting\lib\isAllowedToProcess.js:18:17)
    at sortNodeProperties (...\node_modules\postcss-sorting\lib\properties-order\sortNodeProperties.js:12:7)
    at ...\node_modules\postcss-sorting\index.js:52:4
    at ...\node_modules\postcss\lib\container.js:360:44
    at ...\node_modules\postcss\lib\container.js:55:18
    at Root.each (...\node_modules\postcss\lib\container.js:41:16)
    at Root.walk (...\node_modules\postcss\lib\container.js:52:17)
    at Proxy.<anonymous> (...\node_modules\postcss\lib\container.js:357:30) {
  postcssNode: <ref *1> Root {
    raws: { semicolon: false, after: '\n' },

My first three lines in tailwind.css

@tailwind base;
@tailwind components;
@tailwind utilities;
hudochenkov commented 1 year ago

I can't reproduce the issue.

What is your PostCSS config? What are the versions of all your related dependencies? Is there a custom syntax provided to PostCSS?