linaria icon indicating copy to clipboard operation
linaria copied to clipboard

Linaria crashes webpack

Open nstepien opened this issue 2 years ago • 0 comments

Environment

  • Linaria version: 4.2.0
  • Bundler (+ version): 5.74.0
  • Node.js version: 18.8.0
  • OS: Win11

Description

webpack 5.74.0 compiled with 1 error in 1118 ms
ERROR in ./src/Component.tsx
Module build failed (from ./node_modules/@linaria/webpack5-loader/lib/index.js):
TypeError: D:\repos\repo\src\Component.tsx: Property name of JSXOpeningElement expected node to be of a type ["JSXIdentifier","JSXMemberExpression","JSXNamespacedName"] but instead got undefined
    at Object.validate (D:\repos\repo\node_modules\@babel\types\lib\definitions\utils.js:131:11)   
    at validateField (D:\repos\repo\node_modules\@babel\types\lib\validators\validate.js:24:9)     
    at validate (D:\repos\repo\node_modules\@babel\types\lib\validators\validate.js:17:3)
    at NodePath._replaceWith (D:\repos\repo\node_modules\@babel\traverse\lib\path\replacement.js:169:5)
    at NodePath._remove (D:\repos\repo\node_modules\@babel\traverse\lib\path\removal.js:59:10)     
    at NodePath.remove (D:\repos\repo\node_modules\@babel\traverse\lib\path\removal.js:38:8)       
    at D:\repos\repo\node_modules\@linaria\utils\lib\scopeHelpers.js:306:42
    at mutate (D:\repos\repo\node_modules\@linaria\utils\lib\scopeHelpers.js:337:19)
    at D:\repos\repo\node_modules\@linaria\utils\lib\scopeHelpers.js:305:5
    at Array.forEach (<anonymous>)

Reproducible Demo

The file where babel/webpack crashes doesn't import linaria, nor does it import any linaria class names 🤷‍♂️ Let me know if you still want a reproducible demo

nstepien avatar Sep 08 '22 14:09 nstepien