postcss / gulp-postcss

Pipe CSS through PostCSS processors with a single parse
MIT License
769 stars 65 forks source link

Node#before is deprecated. Use Node#raws.before #118

Closed h0tc0d3 closed 7 years ago

h0tc0d3 commented 7 years ago

In latest version:

Node#before is deprecated. Use Node#raws.before
(node:6676) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot set property 'parent' of undefined
(node:6676) 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.
(node:6676) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: Cannot set property 'parent' of undefined
(node:6676) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): TypeError: Cannot set property 'parent' of undefined
(node:6676) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 4): TypeError: Cannot set property 'parent' of undefined
(node:6676) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 5): TypeError: Cannot set property 'parent' of undefined
(node:6676) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 6): TypeError: Cannot set property 'parent' of undefined
(node:6676) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 7): TypeError: Cannot set property 'parent' of undefined
(node:6676) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 8): TypeError: Cannot set property 'parent' of undefined

In v6.3.0 all fine. The bug is manifested with postcss-import https://github.com/postcss/postcss-import/issues/285

w0rm commented 7 years ago

gulp-postcss bumped the major version of PostCSS, so there may be incompatibilities with some plugins. Please check what plugins are broken, update them to the most recent versions, or open issues in the corresponding repositories. You can always use the previous version of gulp-postcss.

h0tc0d3 commented 7 years ago

This bug manifests only in gulp-postcss + postcss-import. I disable all plugins and found this chain. These two plug-ins create this effect. If i install gulp-postcss@6.3.0 + postcss 6.0.1 then no errors and all works fine.

w0rm commented 7 years ago

Does it work with gulp-postcss 6.4.0?

h0tc0d3 commented 7 years ago

Work. Bug only in "gulp-postcss": "^7.0.0".

w0rm commented 7 years ago

The only change between 6.4.0 and 7.0.0 was a bump of postcss from 5 to 6. So it must be related to this. This proves my first comment was correct.

jonathantneal commented 7 years ago

FWIW Node#before is deprecated. Use Node#raws.before is an unnecessary message in PostCSS itself that you receive when following the correct usage.

AntonioRedondo commented 7 years ago

I have the same issue described by @h0tc0d3. However the error message go when commenting out the precss plug-in. Is it worth it to open a bug report on your repo @jonathantneal?

h0tc0d3 commented 7 years ago

@AntonioRedondo https://github.com/jonathantneal/postcss-partial-import/issues/41