Closed yshrsmz closed 2 years ago
I started receiving a similar compilation error after upgrading from Tailwind 3.0.23 to 3.0.24 but have yet to narrow down the specific code in my app that is triggering it.
TypeError: Cannot set properties of undefined (setting 'parent')
at Proxy.removeChild (/Users/dwight/Sites/my-rent/node_modules/postcss/lib/container.js:219:38)
at Rule.remove (/Users/dwight/Sites/my-rent/node_modules/postcss/lib/node.js:78:19)
at processApply (/Users/dwight/Sites/my-rent/node_modules/tailwindcss/lib/lib/expandApplyAtRules.js:427:31)
at /Users/dwight/Sites/my-rent/node_modules/tailwindcss/lib/lib/expandApplyAtRules.js:16:9
at /Users/dwight/Sites/my-rent/node_modules/tailwindcss/lib/processTailwindFeatures.js:47:50
at plugins (/Users/dwight/Sites/my-rent/node_modules/tailwindcss/lib/index.js:33:58)
at LazyResult.runOnRoot (/Users/dwight/Sites/my-rent/node_modules/postcss/lib/lazy-result.js:339:16)
at LazyResult.runAsync (/Users/dwight/Sites/my-rent/node_modules/postcss/lib/lazy-result.js:393:26)
at async Promise.all (index 0)
error Command failed with exit code 1.
same here, seems to happen when nesting a @screen
block under any standard css rule. sticking to 3.0.23
using: sveltekit, @tailwindcss/forms, poscss, tailwindcss/nesting, postcss-extend-rule
Same issue when upgrading using Tailwind, postcss & StencilJS
I'm experiencing same issue with Tailwind on 3.0.24 version. On 3.0.23 compiling works fine for now.
@dwightwatson Can you provide a reproduction for for error please? I'm trying to track down the source of the problem (which might be a bug in a dependency that we've inadvertently to but I'm not yet certain)
We're definitely hitting a postcss bug here that's caused by an interaction between the user css cache we build for @apply
and our collapsing/merging of duplicate declarations.
I've opened an issue there: https://github.com/postcss/postcss/issues/1738
I narrowed down these culprits in our app, which appear to be same issue as OP - using @screen nested breaks the build.
Using @screen md
under an element:
dialog {
@apply top-8 bg-transparent;
@screen md {
@apply mt-12;
}
}
.footer {
@apply bg-gray-200 py-10;
&--small {
@apply bg-gray-300 py-5 shadow;
}
&__subtext {
@apply mb-3 text-sm text-gray-700;
@screen md {
@apply mb-0;
}
}
}
PostCSS 8.4.13 was released with this fix. I'll leave this open until we update the built-in version in the CLI as well.
Please run npm upgrade
(or similar for your package manager) to upgrade PostCSS.
Alright our insiders build includes an updated postcss version integrated into the CLI. Thanks again for opening this issue and helping us figure this out! 🙌
What version of Tailwind CSS are you using?
v3.0.24
What build tool (or framework if it abstracts the build tool) are you using?
postcss-cli v9.1.0
What version of Node.js are you using?
v16.14.2
What browser are you using?
Chrome
What operating system are you using?
macOS
Reproduction URL
https://github.com/yshrsmz/tailwindcss-issue-8160
Describe your issue
when used in conjunction with
@tailwindcss/nesting
, the following postcssthrows error below.
If I remove
or
then it compiles fine.
Also, it compiles fine in v3.0.23.