mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
a7c56a5b6b
`StyledComponentsTransformConfig` should've used `#[serde(default)]` to allow the user to provide a partial object with only some of the fields. https://serde.rs/container-attrs.html#default > When deserializing, any missing fields should be filled in from the struct's implementation of `Default`. Only allowed on structs. Without that, when serde tries to deserialize, it is expecting that the object has all of it's fields filled in, and breaks because you've only got two of them. The test suite only ever tested `styledComponents: true` (not using an object), so it missed this. ## Test Plan ``` pnpm swc-build-native TURBOPACK=1 TURBOPACK_DEV=1 pnpm test test/development/basic/styled-components ```
8 lines
96 B
JavaScript
8 lines
96 B
JavaScript
module.exports = {
|
|
compiler: {
|
|
styledComponents: {
|
|
displayName: true,
|
|
},
|
|
},
|
|
}
|