-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[vite] Internal server error: Maximum call stack size exceeded #11382
Comments
I downloaded the playground as a local Vite project and cannot reproduce the issue. Both dev and build are working as intended. Could you please provide a repo that can actually show the error? |
@yyx990803 I can provide access to the repository, but not publicly as it's part of the company. However, I can invite you to it if that works for you. |
@yyx990803 Invitation sent through GitHub : repo named You have to change vue version for the entire project by searching for You can also test with The error should appear linked to the |
@yyx990803 I guess this is linked to this modification bdeac37 in the 3.4.28 version |
@nathan-de-pachtere I can't find the invitation in my emails. Can you just post the link to the private repo here? |
@yyx990803 Here it is : https://github.com/alpsify/alpsify |
Still an issue on 3.4.38. @yyx990803 Did you get access to the repo ? |
@yyx990803 I tried using version 3.4.38 and modified the code in the compiler-sfc.cjs.js file as follows:
function loadTSConfig(configPath, ts2, fs) {
const parseConfigHost = ts2.sys;
const config = ts2.parseJsonConfigFileContent(
ts2.readConfigFile(configPath, fs.readFile).config,
parseConfigHost,
path$3.dirname(configPath),
void 0,
configPath
);
const res = [config];
if (config.projectReferences) {
for (const ref of config.projectReferences) {
tsConfigRefMap.set(ref.path, configPath)
res.unshift(...loadTSConfig(ref.path, ts, fs))
/*const refPath = ts2.resolveProjectReferencePath(ref);
if (!fs.fileExists(refPath)) {
continue;
}
tsConfigRefMap.set(refPath, configPath);
res.unshift(...loadTSConfig(refPath, ts2, fs));*/
}
}
return res;
} After confirming that everything works correctly with the changes, I started digging deeper into the reason behind this modification. I also work in a monorepo with Yarn workspaces and Moonrepo. I maintain a single Maybe I'm missing something about how Or maybe it's the way I also tried cleaning up the |
@yyx990803 Looking at the reproducer in #10907, it appears that a code change was made in Vue.js to address a problem that actually stems from the project's specific structural choices. Specifically:
Overall, it feels like the fix addresses an edge case that arises from specific, custom structural choices rather than following the "standard" approach. Or maybe I'm missing something. If @cyrilluce from #10907 could join the discussion, that would be great. |
@nathan-de-pachtere Try to modify code to verify if (config.projectReferences) {
for (const ref of config.projectReferences) {
const refPath = ts.resolveProjectReferencePath(ref)
if (!fs.fileExists(refPath)) {
continue
}
// ------ Add these code
if(tsConfigRefMap.has(refPath)){
continue
}
// --------
tsConfigRefMap.set(refPath, configPath)
res.unshift(...loadTSConfig(refPath, ts, fs))
}
} |
@cyrilluce First, thanks for joining the discussion. The change you suggested makes it work: if(tsConfigRefMap.has(refPath)){
continue
} Could you explain how this change resolves the issue? Feels like I'm gonna learn something here. =D We use multiple Python scripts to check for circular dependencies at multiple levels (package, tsconfig, import), and nothing shows up. Also, Madge and DepsCruiser. We have a monorepo with 6 projects and over 100 lib packages that reference each other and for sure used by projects, so we continuously monitor for circular dependencies to avoid issues. Additionally, our tsconfig.json files are entirely managed by Moonrepo, our solution for managing the monorepo. So we don’t manually change the references and paths in tsconfig.json for each library or project : precisely to avoid errors. |
@nathan-de-pachtere
I guess you are using folder path in your tsconfig reference, before my previous PR it will just get a empty config, and them ignore it. Maybe I should make a pr to fix it |
@cyrilluce It would be amazing if you could create a PR for that. |
@nathan-de-pachtere Indirectly circular reference also dose, e.g. |
@cyrilluce Thanks for that quick PR |
Vue version
3.4.28 and above
Link to minimal reproduction
https://play.vuejs.org/#eNq1U01v00AQ/SujVYUTKSQicEAmTVWgh3KACjiuRCxnnGzrrK3dcRuw/N+ZWSeuk34gDr3EmY+dffPe21qdl+X4tkIVq5lPnSkJPFJVQp7Y1alW5LWaa2s2ZeEIanCYjWCJmbF47n/b9FPBFYuWoIHMFRuIeFikrbZpYT2B1N/A6aNHBoMhnM6hnT2IxpPQLGii4fCDtrNJi4jv54BwU+YJIUcAs3auTTbIIF2R3iBpBWtjieO10WrCfbNJ75Aa8TIMKjOr8bUvLG9cyyitUp5lcnTfSjIMWqsYQkVqSZ4Xd19CjlyFo30+XWN680j+2m8lp9WVQ4/uFrXqapS4lcCU8sWPr7jl/11xUyyrnLufKX5HX+SVYGzbPlZ2ybB7fQHtZeDT2NVPf7EltH6/lACVzib0a8VEC41PrX4P9+34XTinbcMsdiqJZ3oEawqqTOWfpninjXy02uXYWpzi3/uM+SNd8glGk+TMl4md13WQE5qGfSCJfTEvaM4p+YRLg22mx3JzuPNzz8mtt/t+vnJF6Tvvtha8tIQuS1KM2IRd5z9Nz81910//x/XTe9dre2do/RmzpMrJD9oRAeasZeQsBk+O9eXbX7ULzAfDkQinSRpiYGOEY0tWWhMvHUOUJXnEYXP0snaCBgAPBTUQp3niPfO3OKl5EJwJhxDm+YjXT16f1KJxA1xnFblhEZISNAvpjJpFT9sH8pmXku4ZJo9YO2CIQ4Z+SOITrHXXjckzebgN0FiCNruDuL+iE06wkZB2kJBb+y3y1n7dopP3y8P5EY6n71XzF6Pj9hY=
Steps to reproduce
Trying to reproduce inside SFC playground but no error showing up ...
Anyway, I was migrating from 3.4.21 to latest release (3.4.32) and my project didn't work anymore, no change in the code just upgraded vue.js version.
So I went minor version by minor version and the last vue.js version working is the 3.4.27 and then with 3.4.28 I got the vite error message
[vite] Internal server error: Maximum call stack size exceeded
targeting the file on component (in my case : "File: /home/xxxx/projects/MyComponent.vue")Something wrong with the Props definition from external files and using them in two components. The error go away if I change my defineProps lines in both components (see SFC playground for context). Then hit another similar issue with another component trickier, can't find a way to solve it ...
What is expected?
Expected to work like previous version
What is actually happening?
An error is thrown :
System Info
Any additional comments?
Running into that error when updating vue.js package from 3.4.21 to 3.4.31
The text was updated successfully, but these errors were encountered: