-
Notifications
You must be signed in to change notification settings - Fork 26
v8.0.0 doesn’t work with CJS #78
Comments
Thanks for reporting this. I’m sorry about this. I will try to get out a fix tonight. For those interested in more technical details — this issue was able to sneak thru because of a flaw in my testing.
|
Running into this issue with the post-css cli. I've run into a similar problem before, and solution I found was to cross compile ESM tests to CJS tests, and then running both with a testing glob. It's an additional issue with offering both ESM and CJS support, but a surprising number of issues can easily be missed if you don't run the tests on both artifacts. Example here: Tap runs all *.test.js files it finds, and my esm to cjs build process also builds tests over to cjs. |
I'm having the same issue. |
FWIW, postcss-at-rules-variables had a very similar issue when they upgraded to PostCSS 8. I don't know if there are enough similarities to take inspiration from, but I thought it was worth mentioning. |
I have this issue too, but running with postcss-cli. Using @valtlai workaround ( |
Can you post an example config file you are doing this in? |
Here is my module.exports = {
plugins: [
require('postcss-import'),
require('postcss-custom-properties'),
require('tailwindcss'),
require('postcss-nesting').default,
require('autoprefixer'),
require('cssnano')({
preset: 'default',
}),
]
} In fact, as soon as I tried to deploy my site, I faced an error in Netlify build log, but I think it's not related with this, as I tried to change to |
This was an issue in the build for CommonJS that should now be resolved in v8.0.1. https://github.com/csstools/postcss-nesting/releases/tag/8.0.1 |
I can confirm that things work again with my setup, thank you! |
The version
8.0.0
doesn’t work when using CJS. That’s because there’s no a default export (module.exports
) but an export calleddefault
(i.e.module.exports.default
). This means the plugin can’t be used with postcss-load-config configured withpackage.json
, for example.Here’s a test code:
And here’s the result when running it from a CLI:
If I import the
default
property:it works as expected:
The text was updated successfully, but these errors were encountered: