TypeScript issue with PropertyValue and TS v4.8.2
See original GitHub issueBug report
Describe the bug
using PropertyValue
for defining a custom util in TypeScript 4.8.2 generates the following typescript error:
TS4118: The type of this node cannot be serialized because its property '[$$PropertyValue]' cannot be serialized.
To Reproduce
I cannot reproduce this in codesandbox because I can’t change the TypeScript version (See: https://github.com/codesandbox/codesandbox-client/issues/942)
- Create a react server with typescript 4.8.2
- Create stitches config
const stitches = createStitches({
utils: {
marginHorizontal: (value: PropertyValue<'margin'>) => ({
marginLeft: value,
marginRight: value
})
}
});
export const { css, config, createTheme, getCssText, globalCss, keyframes, reset, styled, theme } =
stitches;
- notice the TS error
Expected behavior
I should be able to use PropertyValue
on TS 4.8.2
Screenshots

System information
- OS: N/A
- Browser: N/A
- Version of Node.js: N/A
- Version of Stitches: 1.2.8
- Version of TypeScript: 4.8.2
Issue Analytics
- State:
- Created a year ago
- Reactions:14
- Comments:7
Top Results From Across the Web
TypeScript issue with PropertyValue and TS v4.8.2 - PullAnswer
I'm on Typescript 4.5.2 and getting the same error, and the error came out ... The last TS version which doesn't throw errors...
Read more >4.8.2: Type serialization error with unique symbol #50720
Bug Report Original issue: stitchesjs/stitches#1078 When two types refer to the same unique symbol and they are combined via inference, ...
Read more >Documentation - TypeScript 4.9
JavaScript's in operator can check whether a property exists on an object. Previously, TypeScript allowed us to narrow away any types that don't...
Read more >typescript - The property 'value' does not exist on value of type ...
This fix breaks my code entirely; says whatever comes next "is not a function". I don't understand the reasoning behind the way TS...
Read more >OData Common Schema Definition Language (CSDL) XML ...
https://docs.oasis-open.org/odata/odata-csdl-xml/v4.01/cos01/odata-csdl-xml-v4.01- ... (XML) 1.1 (Second Edition), F. Yergeau, E. Maler, J. Cowan, T. Bray, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
If you’re using VS Code you can switch to the workspace version of TypeScript, by default it will use VS Code’s version.
Since this has changed between 4.7 and 4.8 - is there any TS issue to track this specific regression/change on their side?