You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Regression Bug: Error "The type of this node cannot be serialized because its property '[fooSymbol]' cannot be serialized." happens but potentially avoidable automatically. #60114
exportconstfooSymbol=Symbol('foo');exporttypeFooSymbol=typeoffooSymbol;exportconstf=<Textendsobject>(flag: boolean)=>(v: T&{[KinFooSymbol]: unknown})=>{/* some logics */};// g1: Error: The type of this node cannot be serialized because its property '[fooSymbol]' cannot be serialized.(4118)exportconstg1=<Textendsobject>()=>f<T>(true);exportconstg2=<Textendsobject>()=>(v: T&{[KinFooSymbol]: unknown})=>{constflag=true;/* some logics */};
🙁 Actual behavior
The function g1 seems correctly typed, exported, but error is shown as The type of this node cannot be serialized because its property '[fooSymbol]' cannot be serialized.(4118) by the compiler. g1 is potentially rewritten in the form of g2, just directly rewrite the given arguments as local constant (or just embed values in all contexts).
🙂 Expected behavior
g1 is acceptable as well as g2.
Additional information about the issue
Generics usage is essential to reproduce this case. I'm not sure if the code example could be minimized.
It's the real case minimization of what I really needed in my projects.
In my case, in 5.9.3, I get that error even when compilerOptions.declaration is not set (or explicitly set to false).
It looks like it's trying to "serialize" an array/tuple type as an object (with its methods as properties, etc.) instead of treating it as an array/tuple.
TS4118: The type of this node cannot be serialized because its property [iterator] cannot be serialized.
TS4118: The type of this node cannot be serialized because its property [unscopables] cannot be serialized.
These warnings come from trying to "serialize" the type of the deeply nested property below from an as const object (needed for inference):
Activity
caeus commentedon Nov 1, 2025
Still happening in 5.9.2 in similar cases, but only if compilerOptions.declararion is set to true
Voltra commentedon Mar 9, 2026
In my case, in 5.9.3, I get that error even when
compilerOptions.declarationis not set (or explicitly set tofalse).It looks like it's trying to "serialize" an array/tuple type as an object (with its methods as properties, etc.) instead of treating it as an array/tuple.
These warnings come from trying to "serialize" the type of the deeply nested property below from an
as constobject (needed for inference):Same with with: