ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
51.1k stars 13.51k forks source link

bug: Cannot read properties of undefined (reading 'includes') #29686

Open erperejildo opened 4 months ago

erperejildo commented 4 months ago

Prerequisites

Ionic Framework Version

v8.x

Current Behavior

I can't run my test due to this error:

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Rejection ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ TypeError: Cannot read properties of undefined (reading 'includes') ❯ addStyle node_modules/@stencil/core/internal/client/index.js:691:104 ❯ attachStyles node_modules/@stencil/core/internal/client/index.js:702:20 ❯ updateComponent node_modules/@stencil/core/internal/client/index.js:1500:5 ❯ node_modules/@stencil/core/internal/client/index.js:1490:38 ❯ enqueue node_modules/@stencil/core/internal/client/index.js:1492:88 ❯ dispatchHooks node_modules/@stencil/core/internal/client/index.js:1490:10 ❯ Array.dispatch node_modules/@stencil/core/internal/client/index.js:1454:26 ❯ consume node_modules/@stencil/core/internal/client/index.js:3018:16 ❯ flush node_modules/@stencil/core/internal/client/index.js:3060:5 ❯ invokeTheCallbackFunction node_modules/jsdom/lib/jsdom/living/generated/Function.js:19:26

Expected Behavior

I should be able to run tests

Steps to Reproduce

  1. Clone this repo: https://github.com/erperejildo/myPayslips
  2. run npm run test.unit

Code Reproduction URL

https://github.com/erperejildo/myPayslips

Ionic Info

Ionic:

   Ionic CLI       : 7.2.0 (C:\Users\Dani\AppData\Roaming\npm\node_modules\@ionic\cli)
   Ionic Framework : @ionic/react 8.2.2

Capacitor:

   Capacitor CLI      : 6.1.0
   @capacitor/android : 6.1.0
   @capacitor/core    : 6.1.0
   @capacitor/ios     : 6.1.0

Utility:

   cordova-res : not installed globally
   native-run  : 2.0.1

System:

   NodeJS : v20.12.2 (C:\Program Files\nodejs\node.exe)
   npm    : 10.5.2
   OS     : Windows 10

Additional Information

I don't have any includes in my component as you can check in the repo. Would it be possible to remove vitest and use just jest?

erperejildo commented 4 months ago

The test itself doesn't fail as you can see: image

image

but it's annoying since it shows 35 errors

thetaPC commented 4 months ago

Thank you for submitting the issue!

I'm not able to access the repro. Please verify that it's been given public access.

Also, there's a new release for Ionic Framework that might have fixed it. I would also recommend updating the latest version. We fixed a bug that might be similar to this one.

erperejildo commented 4 months ago

Thank you for submitting the issue!

I'm not able to access the repro. Please verify that it's been given public access.

Also, there's a new release for Ionic Framework that might have fixed it. I would also recommend updating the latest version. We fixed a bug that might be similar to this one.

Fixed. Ok, I will try later