Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

Maximum call stack size exceeded #168

Closed
edgarasben opened this issue Mar 27, 2021 · 7 comments · Fixed by #167
Closed

Maximum call stack size exceeded #168

edgarasben opened this issue Mar 27, 2021 · 7 comments · Fixed by #167

Comments

@edgarasben
Copy link

edgarasben commented Mar 27, 2021

What version of @tailwindcss/jit are you using?

v0.1.11 → (Updated: v0.1.12)

What version of Node.js are you using?

v14.15.1

What browser are you using?

Safari

What operating system are you using?

macOS

Reproduction repository

https://github.com/edgarasben/bulletproof-ui/blob/main/src/Button.jsx

I get an error only when I switch to '@tailwindcss/jit' PostCSS plugin and I am trying to build a conditional CSS classes with React + Vite.

The error occurs when I add this to the Button.jsx file:

  const types = {
    primary: 'bg-blue-600 hover:bg-blue-700 text-white',
    secondary:
      'bg-blue-700 text-blue-600 hover:bg-blue-700 bg-opacity-20 hover:bg-opacity-30',
  }
  const whichType = types[props.buttonType]

Error log

[plugin:vite:css] Maximum call stack size exceeded
/Users/edgaras/Documents/Sites/bulletproof-ui/src/index.css
    at candidatePermutations (/Users/edgaras/Documents/Sites/bulletproof-ui/node_modules/@tailwindcss/jit/src/lib/generateRules.js:19:32)
    at candidatePermutations (/Users/edgaras/Documents/Sites/bulletproof-ui/node_modules/@tailwindcss/jit/src/lib/generateRules.js:41:10)
    at candidatePermutations.next (<anonymous>)
    at candidatePermutations (/Users/edgaras/Documents/Sites/bulletproof-ui/node_modules/@tailwindcss/jit/src/lib/generateRules.js:41:10)
    at candidatePermutations.next (<anonymous>)
    at candidatePermutations (/Users/edgaras/Documents/Sites/bulletproof-ui/node_modules/@tailwindcss/jit/src/lib/generateRules.js:41:10)
    at candidatePermutations.next (<anonymous>)
    at candidatePermutations (/Users/edgaras/Documents/Sites/bulletproof-ui/node_modules/@tailwindcss/jit/src/lib/generateRules.js:41:10)
    at candidatePermutations.next (<anonymous>)
    at candidatePermutations (/Users/edgaras/Documents/Sites/bulletproof-ui/node_modules/@tailwindcss/jit/src/lib/generateRules.js:41:10
@u12206050
Copy link

Getting a very similar issue but seems tied to postcss-loader:

RangeError: Maximum call stack size exceeded
    at candidatePermutations (/Users/gl/Sites/africa/node_modules/@tailwindcss/jit/src/lib/generateRules.js:19:32)
    at candidatePermutations.next (<anonymous>)
    at candidatePermutations (/Users/gl/Sites/africa/node_modules/@tailwindcss/jit/src/lib/generateRules.js:41:10)
    at candidatePermutations.next (<anonymous>)
    at candidatePermutations (/Users/gl/Sites/africa/node_modules/@tailwindcss/jit/src/lib/generateRules.js:41:10)
    at candidatePermutations.next (<anonymous>)
    at candidatePermutations (/Users/gl/Sites/africa/node_modules/@tailwindcss/jit/src/lib/generateRules.js:41:10)
    at candidatePermutations.next (<anonymous>)
    at candidatePermutations (/Users/gl/Sites/africa/node_modules/@tailwindcss/jit/src/lib/generateRules.js:41:10)
    at candidatePermutations.next (<anonymous>)
    at candidatePermutations (/Users/gl/Sites/africa/node_modules/@tailwindcss/jit/src/lib/generateRules.js:41:10)
    at candidatePermutations.next (<anonymous>)
    at candidatePermutations (/Users/gl/Sites/africa/node_modules/@tailwindcss/jit/src/lib/generateRules.js:41:10)
    at candidatePermutations.next (<anonymous>)
    at candidatePermutations (/Users/gl/Sites/africa/node_modules/@tailwindcss/jit/src/lib/generateRules.js:41:10)
    at candidatePermutations.next (<anonymous>)

@adamwathan
Copy link
Member

Fixed in v0.1.13, sorry about that!

@edgarasben
Copy link
Author

Works great now! Thank you. 🙏

@prbroadfoot
Copy link

Fixed in v0.1.13, sorry about that!

I am still getting "Maximum call stack size exceeded" error in v0.1.13 (v0.1.11 works)

@adamwathan
Copy link
Member

@prbroadfoot Can you provide a reproduction? What input is triggering the overflow?

@prbroadfoot
Copy link

@adamwathan

I have purge watching a directory of JS files compiled from ClojureScript. Here is one of the files that triggers it:

https://gist.github.com/prbroadfoot/e4eee9a106fa6f551e9ba2c5d1827876

@adamwathan
Copy link
Member

@prbroadfoot I just tried running against that file locally and had no issues. Any chance you can create a GitHub repo I can clone that reproduces please? In a new issue would be ideal so I don't lose track of it 👍🏻

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

Successfully merging a pull request may close this issue.

4 participants