rollup-plugin-postcss-lit icon indicating copy to clipboard operation
rollup-plugin-postcss-lit copied to clipboard

Issue with Vitest

Open lucaseverett opened this issue 2 years ago • 1 comments

Vitest has stopped working when using rollup-plugin-postcss-lit. The issue started happening with a recent release of Vitest or Vite.

I've tried with both jsdom and happy-dom. The issue can be reproduced using the following repo.

https://github.com/lucaseverett/counter-lit

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Errors ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

Vitest caught 1 unhandled error during the test run.
This might cause false positive tests. Resolve unhandled errors to make sure your tests are not affected.

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Rejection ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
 ❯ node_modules/@lit/reactive-element/node/css-tag.js:6:1193
 ❯ S node_modules/@lit/reactive-element/node/css-tag.js:6:1073
 ❯ Counter.createRenderRoot node_modules/@lit/reactive-element/node/reactive-element.js:6:2996
 ❯ Counter.createRenderRoot node_modules/lit-element/lit-element.js:6:163
 ❯ Counter.connectedCallback node_modules/@lit/reactive-element/node/reactive-element.js:6:3108
 ❯ Counter.connectedCallback node_modules/lit-element/lit-element.js:6:478
TypeError: Cannot read properties of undefined (reading 'cssText')
 ❯ Counter._connectToNode node_modules/happy-dom/lib/nodes/node/Node.js:417:22
 ❯ ShadowRoot.insertBefore node_modules/happy-dom/lib/nodes/node/Node.js:317:17
 ❯ ShadowRoot.insertBefore node_modules/happy-dom/lib/nodes/document-fragment/DocumentFragment.js:187:35
 ❯ ShadowRoot.insertBefore node_modules/happy-dom/lib/nodes/node/Node.js:295:22
 ❯ ShadowRoot.insertBefore node_modules/happy-dom/lib/nodes/document-fragment/DocumentFragment.js:187:35
 ❯ S node_modules/lit-html/node/lit-html.js:6:4914
 ❯ S.k node_modules/lit-html/node/lit-html.js:6:4980
 ❯ S.T node_modules/lit-html/node/lit-html.js:6:5354
 ❯ S._$AI node_modules/lit-html/node/lit-html.js:6:4809
 ❯ A node_modules/lit-html/node/lit-html.js:6:1015
 ❯ App.update node_modules/lit-element/lit-element.js:6:406
 ❯ App.performUpdate node_modules/@lit/reactive-element/node/reactive-element.js:6:4944
 ❯ App.scheduleUpdate node_modules/@lit/reactive-element/node/reactive-element.js:6:4591
 ❯ App._$Ej node_modules/@lit/reactive-element/node/reactive-element.js:6:4499

lucaseverett avatar Sep 19 '22 22:09 lucaseverett

Hey @lucaseverett, are you still experiencing this issue? I cannot reproduce it on vite@4 and [email protected]

umbopepato avatar Jun 21 '23 11:06 umbopepato