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.

Using both screen directive and breakpoint prefix throws error in v3.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-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 postcss

@tailwind base;
@tailwind components;
@tailwind utilities;

.page-title {
  @apply text-gray-700 text-center py-5 border-b border-gray-200;
  @apply sm:mx-auto sm:py-10;

  @screen sm {
    width: auto;
  }
}

throws error below.

TypeError: Cannot set properties of undefined (setting 'parent')
    at Proxy.removeChild (/Users/yshrsmz/repos/github.com/yshrsmz/tailwind-issue/node_modules/postcss/lib/container.js:219:38)
    at AtRule.normalize (/Users/yshrsmz/repos/github.com/yshrsmz/tailwind-issue/node_modules/postcss/lib/container.js:292:32)
    at AtRule.append (/Users/yshrsmz/repos/github.com/yshrsmz/tailwind-issue/node_modules/postcss/lib/container.js:147:24)
    at AtRule.append (/Users/yshrsmz/repos/github.com/yshrsmz/tailwind-issue/node_modules/postcss/lib/at-rule.js:13:18)
    at /Users/yshrsmz/repos/github.com/yshrsmz/tailwind-issue/node_modules/tailwindcss/lib/lib/collapseAdjacentRules.js:24:29
    at Root.each (/Users/yshrsmz/repos/github.com/yshrsmz/tailwind-issue/node_modules/postcss/lib/container.js:41:16)
    at collapseRulesIn (/Users/yshrsmz/repos/github.com/yshrsmz/tailwind-issue/node_modules/tailwindcss/lib/lib/collapseAdjacentRules.js:9:14)
    at /Users/yshrsmz/repos/github.com/yshrsmz/tailwind-issue/node_modules/tailwindcss/lib/lib/collapseAdjacentRules.js:42:9
    at /Users/yshrsmz/repos/github.com/yshrsmz/tailwind-issue/node_modules/tailwindcss/lib/processTailwindFeatures.js:51:53
    at plugins (/Users/yshrsmz/repos/github.com/yshrsmz/tailwind-issue/node_modules/tailwindcss/lib/index.js:33:58)
error Command failed with exit code 1.

If I remove

@apply sm:mx-auto sm:py-10;

or

@screen sm {
  width: auto;
}

then it compiles fine.

Also, it compiles fine in v3.0.23.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:8
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
thecrypticacecommented, May 2, 2022

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! 🙌

2reactions
thecrypticacecommented, Apr 26, 2022

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

is a custom class, make sure it is defined within a `@layer ...
The error warning you've posted relates to the use of a dark: -prefixed class - a class that is applied only in "Dark...
Read more >
Bug listing with status RESOLVED with resolution UPSTREAM ...
problem using ErrorDocument with LimitRequestBody directive" ... tweak TCP settings but getting errors" status:RESOLVED resolution:UPSTREAM severity:normal ...
Read more >
Developing Python Web Applications with Flask
My experience is that you CANNOT write a JavaScript without the developer console, as no visible message will be shown when an error...
Read more >
dartdoc 5.0.0 | Dart Package - Pub.dev
A non-interactive HTML documentation generator for Dart source code.
Read more >
Changelog | Meteor API Docs
Throwing error when trying to send email in a production environment but ... You are now able to use dark theme specific splash...
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