csstools / postcss-nesting

Nest style rules inside each other

Home Page:https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-nesting

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`RangeError: Maximum call stack size exceeded` after upadte

krns opened this issue · comments

Hi,

after merging the dependabot PR Bump postcss-nesting from 8.0.1 to 9.0.0 our pipeline fails with the following error:

#17 24.92 ERROR in ./assets/styles/admin-app.css
#17 24.92 Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
#17 24.92 ModuleBuildError: Module build failed (from ./node_modules/postcss-loader/dist/cjs.js):
#17 24.92 RangeError: Maximum call stack size exceeded
#17 24.92     at /opt/app/node_modules/quill/dist/quill.snow.css:39:3
#17 24.92     at Function.keys (<anonymous>)
#17 24.92     at _clone (/opt/app/node_modules/postcss-preset-env/node_modules/autoprefixer/lib/prefixer.js:22:42)
#17 24.92     at _clone (/opt/app/node_modules/postcss-preset-env/node_modules/autoprefixer/lib/prefixer.js:38:17)
#17 24.92     at _clone (/opt/app/node_modules/postcss-preset-env/node_modules/autoprefixer/lib/prefixer.js:38:17)
#17 24.92     at _clone (/opt/app/node_modules/postcss-preset-env/node_modules/autoprefixer/lib/prefixer.js:38:17)
#17 24.92     at _clone (/opt/app/node_modules/postcss-preset-env/node_modules/autoprefixer/lib/prefixer.js:38:17)
#17 24.92     at _clone (/opt/app/node_modules/postcss-preset-env/node_modules/autoprefixer/lib/prefixer.js:38:17)
#17 24.92     at _clone (/opt/app/node_modules/postcss-preset-env/node_modules/autoprefixer/lib/prefixer.js:38:17)
#17 24.92     at _clone (/opt/app/node_modules/postcss-preset-env/node_modules/autoprefixer/lib/prefixer.js:38:17)
#17 24.92     at _clone (/opt/app/node_modules/postcss-preset-env/node_modules/autoprefixer/lib/prefixer.js:38:17)
#17 24.92     at processResult (/opt/app/node_modules/webpack/lib/NormalModule.js:701:19)
#17 24.92     at /opt/app/node_modules/webpack/lib/NormalModule.js:807:5
#17 24.92     at /opt/app/node_modules/loader-runner/lib/LoaderRunner.js:399:11
#17 24.92     at /opt/app/node_modules/loader-runner/lib/LoaderRunner.js:251:18
#17 24.92     at context.callback (/opt/app/node_modules/loader-runner/lib/LoaderRunner.js:124:13)
#17 24.92     at Object.loader (/opt/app/node_modules/postcss-loader/dist/index.js:142:7)

The admin-css.app only imports some css files, like quill.snow.css. Because quill is mentioned in the stacktrace (/opt/app/node_modules/quill/dist/quill.snow.css:39:3) I looked into the css file but there is nothing suspicious: https://cdn.quilljs.com/1.3.7/quill.snow.css

Before the update to postcss-nesting 9.0.0 everything worked as expected. Do you guys have any clue whats the cause of this problem?

Thanks in advance.

Could you try to turn off postcss-nesting? I didn't see postcss-nesting in stacktrace.

Removing postcss-nesting from the project solves the problem... I removed postcss-nesting from my package.json and webpack config:

const postCssConfig = [
    plugins: [
      require('stylelint')()
    ]
  }),

- require('tailwindcss/nesting')(require('postcss-nesting')),
  require('tailwindcss'),
  require('postcss-preset-env')({
    stage: 1,
    features: { 'nesting-rules': false }
  })

Removing postcss-nesting from the project solves the problem... I removed postcss-nesting from my package.json and webpack config:

const postCssConfig = [
    plugins: [
      require('stylelint')()
    ]
  }),

- require('tailwindcss/nesting')(require('postcss-nesting')),
  require('tailwindcss'),
  require('postcss-preset-env')({
    stage: 1,
    features: { 'nesting-rules': false }
  })

I have a similar usage (use postcss-nesting with tailwindcss), and I see this error as well.

However, I can't be sure if it was caused by postcss-nesting actually (even though removing that line from config seems to fix this problem) because I also tried to remove postcss-preset-env instead of postcss-nesting and it did fix the problem too! (of course, all transformations are gone except nesting).

Don't know what is the correct way to solve this, stay on hold.

Would it be possible to create an example repo with this issue?
Don't have any experience with tailwind but if we can reproduce the issue locally we might be able to resolve it.

@krns @nightire This repo has been moved to https://github.com/csstools/postcss-plugins and will be archived soon.

If you still have issues with this please open a new issue there.
We're happy to assist you further in getting this resolved!

As we can't reproduce this as is it would be really helpful to have a github repo with an example of the issue.

Closing this issue as it's not possible to comment on issues in archived repo's.