MadLittleMods / postcss-css-variables

PostCSS plugin to transform CSS Custom Properties(CSS variables) syntax into a static representation
https://madlittlemods.github.io/postcss-css-variables/playground/
Other
536 stars 62 forks source link

Maximum call stack exceeded #135

Open maciekpaprocki opened 1 year ago

maciekpaprocki commented 1 year ago

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 commented 1 year ago

@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 commented 3 months ago

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