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
If a class component is declared in the same file as it's being styled with styled, it causes the following error:
TypeError: Property declarations[0] of VariableDeclaration expected node to be of a type ["VariableDeclarator"] but instead got "ClassDeclaration"
at validate (/Users/silvenon/Code/test/linaria/node_modules/@babel/types/lib/definitions/utils.js:131:13)
at validator (/Users/silvenon/Code/test/linaria/node_modules/@babel/types/lib/definitions/utils.js:100:7)
at Object.validate (/Users/silvenon/Code/test/linaria/node_modules/@babel/types/lib/definitions/utils.js:201:7)
at validateField (/Users/silvenon/Code/test/linaria/node_modules/@babel/types/lib/validators/validate.js:22:9)
at validate (/Users/silvenon/Code/test/linaria/node_modules/@babel/types/lib/validators/validate.js:16:3)
at builder (/Users/silvenon/Code/test/linaria/node_modules/@babel/types/lib/builders/builder.js:46:27)
at Object.VariableDeclaration (/Users/silvenon/Code/test/linaria/node_modules/@babel/types/lib/builders/generated/index.js:427:31)
at resolve (/Users/silvenon/Code/test/linaria/node_modules/linaria/lib/babel/evaluate.js:80:22)
at evaluate (/Users/silvenon/Code/test/linaria/node_modules/linaria/lib/babel/evaluate.js:114:5)
at TaggedTemplateExpression (/Users/silvenon/Code/test/linaria/node_modules/linaria/lib/babel/visitors/TaggedTemplateExpression.js:257:46)
Reproducible Demo
Install core-js 2 to avoid #468 and install Babel CLI:
Environment
Description
If a class component is declared in the same file as it's being styled with
styled
, it causes the following error:Reproducible Demo
Install
core-js
2 to avoid #468 and install Babel CLI:Configure Babel:
Define a class component and style it with Linaria:
Try to compile the code with Babel CLI:
The text was updated successfully, but these errors were encountered: