question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@media and postcss-nested no longer work in 3.0.24

See original GitHub issue

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@8.4.13

**What version of Node.js are you using?**v16.0.0

What operating system are you using? macOS

Reproduction URL https://github.com/nghiepit/tailwindcss-3-0-24-bug

Describe your issue My styles

body {
  @apply text-red-500;

  @media (max-width: 1000px) {
    @apply text-green-500; // <== ERROR
    div {
      @apply text-blue-500; // <== ERROR
    }
  }

  div {
    @apply text-yellow-50;
  }
}
// postcss.config.js
module.exports = {
  plugins: {
    'tailwindcss/nesting': {},
    tailwindcss: {},
  },
};

In the v.3.0.24 will be throw an error

TypeError: Cannot set properties of undefined (setting ‘parent’)

But in the CHANGELOG.md I don’t see any breaking changes.

And in the v.3.0.23 the output correctly:

body {
  --tw-text-opacity: 1;
  color: rgb(239 68 68 / var(--tw-text-opacity))
}

@media (max-width: 1000px) {
  body {
    --tw-text-opacity: 1;
    color: rgb(34 197 94 / var(--tw-text-opacity))
  }

  body div {
    --tw-text-opacity: 1;
    color: rgb(59 130 246 / var(--tw-text-opacity))
  }
}

body div {
  --tw-text-opacity: 1;
  color: rgb(254 252 232 / var(--tw-text-opacity))
}

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:6

github_iconTop GitHub Comments

3reactions
chrismluskcommented, May 5, 2022

Thanks for working on this!

However, if the current fix is only available on the insiders build, should this issue be closed? If others aren’t comfortable using the insiders build in production apps, shouldn’t this issue remain open as a signal about this problem specific to v3.0.24?

2reactions
thecrypticacecommented, May 5, 2022

Okay, it’s still insiders built only — we don’t have a normal tagged release yet where you can override the postcss dependency but the situation itself has been taken care of and it’ll be possible in the future to work around situations like these. Sorry for all the trouble — and thanks again!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unexpected exception on upgrading from 5.0.1 to 5.0.2 #106
I'm having the same issue since I upgraded postcss-nested from 5.0.1 to 5.0.3. Error is TypeError: node.getIterator is not a function.
Read more >
Nextjs config with postcss nesting doesn't work - Stack Overflow
I am using nextjs with tailwindcss and i am facing the difficulty in adding postcss-nesting to my nextjs app.
Read more >
Upgrade Guide - Tailwind CSS
Note that Tailwind CSS v3.0 requires PostCSS 8, and no longer supports PostCSS 7. If you can't upgrade to PostCSS 8, we recommend...
Read more >
postcss-nested - npm
PostCSS plugin to unwrap nested rules like how Sass does it. Latest version: 6.0.0, last published: 3 months ago. Start using postcss-nested ......
Read more >
Open Source Disclosures - SnapAttack
COMPONENT NAME VERSION LICENSE @amplitude/types 1.8.2 MIT @amplitude/ua‑parser‑js 0.7.24 MIT @amplitude/utils 1.8.2 MIT
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found