File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
packages/@triplex/server/src/ast Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @triplex/server " : patch
3+ ---
4+
5+ Prevent maximum call stack exceeded errors by limiting TypeScript import resolution depth. Added ` skipLibCheck ` and ` maxNodeModuleJsDepth ` compiler options to prevent infinite loops when resolving complex import graphs.
Original file line number Diff line number Diff line change @@ -45,6 +45,9 @@ export function _createProject({
4545 compilerOptions : {
4646 // This ensures that even if a project is misconfigured we can still infer types from JS.
4747 allowJs : true ,
48+ // Limit the depth TypeScript searches through node_modules to prevent stack overflow
49+ // errors caused by deeply nested or circular package.json references.
50+ maxNodeModuleJsDepth : 0 ,
4851 // This forces the module resolution to use the bundler algorithm. This fixes @react -three/uikit for use in Triplex
4952 // without userland needing to fix it.
5053 // See: https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/#--moduleresolution-bundler
@@ -53,6 +56,9 @@ export function _createProject({
5356 // node_modules. We set this to false to ensure that consumers of triplex never run into
5457 // this.
5558 preserveSymlinks : false ,
59+ // Skip type checking of declaration files to reduce recursive imports and prevent
60+ // maximum call stack errors when TypeScript walks complex node_modules structures.
61+ skipLibCheck : true ,
5662 // We turn this off so we can effectively ignore null and undefined when fetching
5763 // the types of jsx elements. This makes everything much easier to reason about.
5864 // Meaning instead of us having to manually iterate and ignore type values they just
You can’t perform that action at this time.
0 commit comments