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

Maximum call stack exceeded #135

Open
maciekpaprocki opened this issue Apr 15, 2023 · 2 comments
Open

Maximum call stack exceeded #135

maciekpaprocki opened this issue Apr 15, 2023 · 2 comments

Comments

@maciekpaprocki
Copy link

Seems like I am getting maximum call stack exceeded on postcss.

used plugins with tailwind

module.exports = {
    plugins: {
        'postcss-import': {},
        'tailwindcss/nesting': {},
        tailwindcss: {},
        autoprefixer: {},
        'postcss-sort-media-queries': {
            'sort': 'mobile-first'
        },

        'postcss-css-variables':{}
    },
}

error

RangeError: Maximum call stack size exceeded
    at Function.keys (<anonymous>)
    at shallowCloneNode (/Users/maciejpaprocki/Projects/bifl-nest/node_modules/postcss-css-variables/lib/shallow-clone-node.js:5:9)
    at /Users/maciejpaprocki/Projects/bifl-nest/node_modules/postcss-css-variables/lib/shallow-clone-node.js:36:13
    at Array.forEach (<anonymous>)
    at shallowCloneNode (/Users/maciejpaprocki/Projects/bifl-nest/node_modules/postcss-css-variables/lib/shallow-clone-node.js:5:19)
    at /Users/maciejpaprocki/Projects/bifl-nest/node_modules/postcss-css-variables/lib/shallow-clone-node.js:36:13
    at Array.forEach (<anonymous>)
    at shallowCloneNode (/Users/maciejpaprocki/Projects/bifl-nest/node_modules/postcss-css-variables/lib/shallow-clone-node.js:5:19)
@MadLittleMods
Copy link
Owner

@maciekpaprocki Which version of postcss-css-variables are you using?

Can you reproduce if you remove those other plugins?

Can you provide a minimal example of the input right before it goes into the postcss-css-variables that causes the error?

@searls
Copy link

searls commented Mar 6, 2024

FWIW, I'm seeing this happen whenever any nesting plugin is before this one in the plugin chain (using tailwind/nesting)

jagthedrummer added a commit to bullet-train-co/bullet_train that referenced this issue Apr 3, 2024
…ables

Fixes #1416
Fixes #1074

As noted in #1416 there's been a change in `tailwindcss` around the
`@apply` directive. In order to get it to work correctly for nested
classes we need to use the `tailswindcss/nesting` plugin. We were already
using `postcss-nested`, which is what `tailwindcss/nesting` uses under
the hood. So this PR just switches them out.

It also moves the `postcss-css-variables` plugin to be higher in the
plugin stack for the mailer stylesheet. [That plugin doesn't play nicely
when it's below the nesting plugin.](MadLittleMods/postcss-css-variables#135 (comment))

Moving `postcss-css-variables` higher in the stack also seems to have
fixed the problems described in #1074. When it's higher in the stack I
see almost zero difference in build times between having it activated or
not, and the resulting stylesheet is actually _smaller_ when it is
activated (~120k vs ~140k).
jagthedrummer added a commit to bullet-train-co/bullet_train that referenced this issue Apr 5, 2024
…ables (#1417)

* Update tailwind, switch to tailwindcss/nesting, move postcss-css-variables

Fixes #1416
Fixes #1074

As noted in #1416 there's been a change in `tailwindcss` around the
`@apply` directive. In order to get it to work correctly for nested
classes we need to use the `tailswindcss/nesting` plugin. We were already
using `postcss-nested`, which is what `tailwindcss/nesting` uses under
the hood. So this PR just switches them out.

It also moves the `postcss-css-variables` plugin to be higher in the
plugin stack for the mailer stylesheet. [That plugin doesn't play nicely
when it's below the nesting plugin.](MadLittleMods/postcss-css-variables#135 (comment))

Moving `postcss-css-variables` higher in the stack also seems to have
fixed the problems described in #1074. When it's higher in the stack I
see almost zero difference in build times between having it activated or
not, and the resulting stylesheet is actually _smaller_ when it is
activated (~120k vs ~140k).

* Add a link to a report about variable support in email clients
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants