parcel-bundler / parcel

The zero configuration build tool for the web. 📦🚀
https://parceljs.org
MIT License
43.26k stars 2.26k forks source link

postcss fails: @parcel/transformer-postcss: Cannot read properties of undefined #9541

Open eekboom opened 4 months ago

eekboom commented 4 months ago

🐛 bug report

I tried to add postcss support to my mantine web app. However, parcel fails while transforming the css with this error:

@parcel/transformer-postcss: Cannot read properties of undefined (reading 'input')

  TypeError: Cannot read properties of undefined (reading 'input')
      at Rule.toJSON (C:\dev\dev\github\eekboom\mantine-min\node_modules\postcss\lib\node.js:330:40)
      at C:\dev\dev\github\eekboom\mantine-min\node_modules\postcss\lib\node.js:322:22
      at Array.map (<anonymous>)
      at Root.toJSON (C:\dev\dev\github\eekboom\mantine-min\node_modules\postcss\lib\node.js:320:29)
      at Object.transform (C:\dev\dev\github\eekboom\mantine-min\node_modules\@parcel\transformer-postcss\lib\PostCSSTransformer.js:245:21)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async Transformation.runTransformer (C:\dev\dev\github\eekboom\mantine-min\node_modules\@parcel\core\lib\Transformation.js:568:5)
      at async Transformation.runPipeline (C:\dev\dev\github\eekboom\mantine-min\node_modules\@parcel\core\lib\Transformation.js:346:36)
      at async Transformation.runPipelines (C:\dev\dev\github\eekboom\mantine-min\node_modules\@parcel\core\lib\Transformation.js:229:40)
      at async Transformation.run (C:\dev\dev\github\eekboom\mantine-min\node_modules\@parcel\core\lib\Transformation.js:149:21)

💻 Code Sample

I made a SSCCE here: https://github.com/eekboom/mantine-min

That project contains both vite and parcel and starts fine with vite, but fails with parcel.

Software Version(s)
Parcel 2.11.0
Node 20.11.0
npm/Yarn yarn 4.0.2
Operating System Windows 10
eekboom commented 4 months ago

Same problem still with parcel 2.12.0 :-(