Grid error during running unit tests (Vitest)

Hi,

I attached a file with an error which pops up every time the tests are run (vitest / Angular). It doesn't appear when I run a single file test for example:

npx nx test vitest-monorepo --testFile=invoice-pos.component.spec.ts

It shows when all tests are run and doesn't concern a particular file or test.

npx nx test vitest-monorepo


Attachment: vitest_unit_tests_error_27d4d3b7.png

2 Replies

SR Sivaranjani Rajasekaran Syncfusion Team April 30, 2026 09:43 AM UTC

Hi Roman Sznajder,


Greetings from Syncfusion support!

We have confirmed that the reported scenario is an issue from our side and logged it as “Script error during Vitest unit testing - EJ2 Angular Grid”. Thank you for taking the time to report this issue and for helping us improve our product. The fix will be included in our patch release, which is scheduled to be rolled out on “May 12th, 2026”.

 

You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.

 

Feedback link: https://www.syncfusion.com/feedback/73909/script-error-during-vitest-unit-testing-syncfusion-ej2-grid

 

Disclaimer: "Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization".



SR Sivaranjani Rajasekaran Syncfusion Team May 12, 2026 05:58 AM UTC

Roman Sznajder,

We are glad to announce that, we have included the fix for the issue “Script error during Vitest unit testing - EJ2 Angular Grid ” in our 33.2.5 release. So please upgrade to our latest version of the Syncfusion package to resolve the reported issue.

 

Root Cause: In Vitest, the Grid’s focusModule is not initialized during initial load, causing setFirstFocusableTabIndex() to be called on undefined.


Solution: Added a null check to ensure the method is invoked only when the module is available, preventing the error.

 

Sample: Please find the sample attached

 

Feedback: https://www.syncfusion.com/feedback/73909/script-error-during-vitest-unit-testing-ej2-angular-grid

 

We thank you for your support and appreciate your patience in waiting for this release. Please get back to us if you need any further assistance.


Regards,
Sivaranjani R


Attachment: sqlogicmonorepo_fixed_c3590a23.zip


Loader.
Up arrow icon