ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

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

Open erperejildo opened this issue 1 year ago • 3 comments
trafficstars

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 avatar Jul 03 '24 10:07 erperejildo

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

image

but it's annoying since it shows 35 errors

erperejildo avatar Jul 03 '24 11:07 erperejildo

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.

thetaPC avatar Jul 03 '24 23:07 thetaPC

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

erperejildo avatar Jul 09 '24 07:07 erperejildo

I have access to the repo now, thanks! However, I'm unable to reproduce the issue. npm run test.unit passes without any issues. Please, confirm on your end?

thetaPC avatar Mar 13 '25 23:03 thetaPC

Thanks for the issue! This issue is being closed due to the lack of a reply. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Thank you for using Ionic!

ionitron-bot[bot] avatar Mar 28 '25 00:03 ionitron-bot[bot]