Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read properties of undefined (reading 'insertAfter') #12854

Open
in-session opened this issue Jan 30, 2024 · 4 comments
Open
Assignees

Comments

@in-session
Copy link

in-session commented Jan 30, 2024

Hello everyone,

we sometimes have a problem with the npx tailwindcss build in different instances:
image

After some investigation of the whole components css the error comes through as @apply font-bold. As soon as we remove this class the generation of the CSS runs.
image

However, we cannot explain how such a problem can occur. Does anyone have an idea how to debug this?

Test on
NGINX 1.24.0 with PHP 8.2
NodeJs: v18.17.1 and 20.5.1 and 21.6.1

├── @tailwindcss/forms@0.5.7
├── @tailwindcss/typography@0.5.10
├── autoprefixer@10.4.17
├── browser-sync@3.0.2
├── postcss-import@14.1.0
├── postcss@8.4.33
└── tailwindcss@3.4.1

as well:
├── @tailwindcss/forms@0.5.3
├── @tailwindcss/typography@0.5.7
├── autoprefixer@10.4.13
├── browser-sync@2.27.10
├── postcss@8.4.18
├── postcss-import@14.1.0
└── tailwindcss@3.2.4

@thecrypticace
Copy link
Contributor

Hey — any chance you can provide a reproduction that we can clone? I just set this up in a Vite project with the above CSS and am not encountering an error.

@in-session
Copy link
Author

Hi, unfortunately not as we are working on a production environment. But I will ask the others. Is there any way of logging the error to find out where the problem could be coming from? We have checked all the logs but can't find an error there.

@mominshaikhdevs
Copy link

Hi @in-session, can you please share a minimal repro?

@in-session
Copy link
Author

We were able to identify the problem. It was a problem within a components module:

#maincontent {
        > div.container.font-bold {
            @apply flex-row justify-between items-center;
            @screen lg {
                @apply flex-col items-start;
            }
        }
    }

The problem here was that the selector div.container.font-bold in the module is a tailwind class.
As a result, the merge process did not run through. Even if the error message was of course not meaningful.

TypeError: Cannot read properties of undefined (reading 'insertAfter')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants