-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 size exceeded #8582
Comments
@jithureddy it looks like you are exporting the I'm also confused about why you want to deepMerge the tailwind config in the first place? The Looking at your config it should suffice to use module.exports = uiConfig And drop all of this: function arrayMergeFn(destinationArray, sourceArray) {
return destinationArray.concat(sourceArray).reduce((acc, cur) => {
if (acc.includes(cur)) return acc
return [...acc, cur]
}, [])
}
/**
* Merge UI components config and Tailwind CSS configurations
* @param {object} tailwindConfig - Tailwind config object
* @return {object} new config object
*/
function wrapper(tailwindConfig) {
return deepMerge({ ...tailwindConfig }, uiConfig, {
arrayMerge: arrayMergeFn,
})
}
module.exports = wrapper Can you create a reproduction repo with a working minimal production that showcases the issue? |
@RobinMalfait Thanks for responding, wrapper is not directly used as tailwind.config.js, the uiConfig exported with wrapper around it from There are couple projects in which we use the above uiConfig, Project 1:
Project 2
I can share a repo but that is private repository, thinking how do I put this into github without breaking my company security policies. |
@adamwathan We really like tailwindcss and we are using since @RobinMalfait I will try to create a repo and share with you soon. But deepMerge was working in 4 projects already with I was working in feature branch, where I had to do eslint and prettier configuration, the repo was working with eslint related fixes and ran Again created another feature branch with only |
We're not doing anything in particular to the config, but we're seeing this error as of |
Is anyone able to provide a real reproduction we can clone down and look at? Just the minimum code necessary to trigger this error. |
From the stack traces provided this appears to be a regex matching problem. Node is running out of stack space when matching. If anyone can narrow it down to a single file that causes the issue that should be enough to reproduce. |
@adamwathan i’ll try to make a reproduction project this weekend |
I tried to make a reproduction on https://github.com/bmichotte/tailwindcss-8582 but I can't reproduce... It compiles just fine now, on three servers and on local ¯\(ツ)/¯ |
Same issue, attempting repro.. edit: could not reproduce and rolling back to 3.0.24 was not effective. This was on an application (vite/vue3/tailwind) that I haven't developed in 4 months, which worked without issues before. I guess I'll have to strip things down until they work and then build it up until it doesn't - I'll post back but my hunch is that this isn't an issue with tailwindcss on its own, but some combination of packages. |
I have same issue but i cant reproduce it |
Hi, I managed to trigger the same kind of error in this repository: https://github.com/spdiswal/tailwindcss-8582 |
@spdiswal Hey! So in your case at least that's an infinite recursion problem and is expected: https://play.tailwindcss.com/1fABzspiRr?file=config — this particular case was an issue in 3.0.24 as well. The fact that it fails on the regex line in your case is, I think, likely a coincidence. It's running into a case of too many recursive function calls. The problem is that the top-level In your case you probably want to use the provided
Alternatively, if you must use the theme function, you can add your colors to
|
I have the same exact issue after updating, I tried to reproduce on a standalone repo, but couldn't... I Will try again later and see if I can get something that reproduce it, but until then, I just wanted to add a comment. |
Hi! 👋 Firstly, thanks for your work on this project! 🙂 Today I used patch-package to patch My problem: Facing Root cause: using push with too many arguments. Here is the diff that solved my problem: diff --git a/node_modules/tailwindcss/lib/lib/defaultExtractor.js b/node_modules/tailwindcss/lib/lib/defaultExtractor.js
index ecb0617..b95200a 100644
--- a/node_modules/tailwindcss/lib/lib/defaultExtractor.js
+++ b/node_modules/tailwindcss/lib/lib/defaultExtractor.js
@@ -52,7 +52,7 @@ function defaultExtractor(context) {
/** @type {(string|string)[]} */ let results = [];
for (let pattern of patterns){
var ref;
- results.push(...(ref = content.match(pattern)) !== null && ref !== void 0 ? ref : []);
+ results = [...results, ...(ref = content.match(pattern)) !== null && ref !== void 0 ? ref : []];
}
return results.filter((v)=>v !== undefined).map(clipAtBalancedParens);
}; This issue body was partially generated by patch-package. |
@adamwathan @RobinMalfait Here is the reproduction repo - https://github.com/jithureddy/tailwind-3.1-template Thanks. I will create another reproduction issue where, tailwind css is not working with storybook setup, please see below error. This is essential for us to see all reusable components in action and documented. |
@adamwathan @RobinMalfait I have created another branch for the above issue when tailwind is used in storybook Interestingly this issue is even persists with Steps
|
Hey! Thanks for the reproduction @nam-tran-tego that was exactly the problem! This should be fixed by #8636, and will be available in the next release (probably later today). You can already try it by using the insiders build @jithureddy thanks, let's keep the conversation about storybook in its own issue 👍 |
@RobinMalfait @adamwathan Thanks 👍 both. @nam-tran-tego Thanks for identifying the issue. The above storybook also works with above insiders build |
Looks good in |
For me the issue persisted even with # tailwind.config.js
module.exports = {
content: ["./index.html", "./src/**/*.{vue,js,ts}",],
theme: {
extend: {},
},
plugins: [
require('@tailwindcss/forms'),
],
} This suggested that maybe |
This will sound really strange, but I managed to fix the error by removing the css:
After that, everything worked. |
I found that I was experiencing this error when accessing the theme directly for the font family. // my tailwind plugin config
...
extend: {
fontFamily: ({ theme }) => ({
sans: ['Roboto', ...theme('fontFamily.sans')],
}),
},
... I am guessing that one cannot access |
i got this when i used |
I am having this same issue when I use if I remove I am using |
I get the same error. But it makes sense I guess. I am using the theme function on top level properties. The theme function is then called on dozens and dozens of properties. Seems like the theme function can only be used sparingly? Like someone mentioned above, recursive. My colors property is referencing colors. My workaround that I will try tomorrow is any value that needs to be referenced, just make a separate object and reference it from there note: I’m not referencing default tailwind values, but my own values |
I got same error. Because I import tailwindcss preprocessor in a lib package, Then I also import tailwindcss preprocess in main project, then the error happend. |
Same issue here - I found it by searching for all "bg-[url" occurrences, and sure enough, one of them didn't finish in ")". Thanks for pointing this out and saving me the headache. |
Discussed in #8578
Originally posted by jithureddy June 10, 2022
Hi, Please help
Just updated my project to latest
"tailwindcss": "^3.1.1"
and using create react app setup from here. It was working great with"tailwindcss": "^3.0.4"
.The text was updated successfully, but these errors were encountered: