postcss / postcss-import

PostCSS plugin to inline at-import rules content
MIT License
1.38k stars 115 forks source link

Fails with `postcss` 8.4.33, `original.line and original.column are not numbers` #556

Closed strmer15 closed 10 months ago

strmer15 commented 10 months ago

The postcss-import plugin currently uses null as the default value of the parser when calling process in postcss, see https://github.com/postcss/postcss-import/blob/d8a9f21f0f62077d05d9b60680cd50e3546fdf6e/lib/process-content.js#L41.

However, in postcss 8.4.33, the parser option was required to be truthy, when before just being "not undefined" would work. See https://github.com/postcss/postcss/commit/c37346d61aa6a5eda3515ff3d271764deb77440a

To fix this, the postcss-import plugin should only send truthy values to the process function as the parser option. Either that, or postcss needs to fix it on their side in https://github.com/postcss/postcss/issues/1914.

Because of this, vite builds are now throwing the error original.line and original.column are not numbers for @import statements in our SASS files.

romainmenke commented 10 months ago

This is unrelated to vite or postcss-import. It can be reproduced with only a specific sourcemap and PostCSS itself : https://github.com/postcss/postcss/issues/1914#issuecomment-1909010753

I'd suggest we close this here given that it isn't actionable here.

romainmenke commented 10 months ago

Seems to be even further upstream in source-map-js : https://github.com/7rulnik/source-map-js/issues/18