babel-plugin-styled-components: 1.13.2 generates cannot read property 'property' of undefined
Iām using Next.js and when trying 1.13.2 I get the following webpack-error for a component:
TypeError: Form.tsx: Cannot read property 'property' of undefined
The only css in the component are three declarations looking like this:
const StyledFormComponent = styled.div display: flex;
;
With 1.13.1 there are no errors.
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 4
- Comments: 19
FYI: Rollup v3
output.generatedCode.reservedNamesAsProps
setting ontrue
is not compatible with this plugin due to this bug. Thus for now whenever you generate code containing styled-components from rollup, setoutput.generatedCode.reservedNamesAsProps
tofalse
in rollup.Adding on @andi1984 I also had added
output.interop: "auto"
to act the same astsconfig.json@compilerOptions.esModuleInterop: true
Mh, understandable.
We will have to go for forking then! Thanks for keeping the project open-source so this is even possible šš¼
Oh, btw found a workaround: setting
"pure": false
skips the code path that blows up