Vitest flake: Failed to import test file
Author: robintownCreated Oct 1, 2026Updated Oct 1, 2026
LabelsZ-Flaky-TestZ-Flaky-Vitest-Test
Today I hit this error many times in a row:
FAIL @element-hq/web-shared-components (storybook) (chromium) src/room/timeline/event-tile/body/MVideoBodyView/VideoBodyView.stories.tsx [ packages/shared-components/src/room/timeline/event-tile/body/MVideoBodyView/VideoBodyView.stories.tsx ]
Error: Failed to import test file /home/runner/work/element-web/element-web/packages/shared-components/.storybook/vitest.setup.ts
❯ runSetupFiles ../../node_modules/.cache/storybook/10.5.8/52cc48694c62608288b0000be341d00786083203ddc6f6e820f3e2a0eddc9703/sb-vitest/vitest/f8437193862b78daa12ee0660971b8b868a1e776/deps/plugins.Cigb0uSy-BHnOlFtn.js?v=092dcbd1:5536:35
❯ ../../node_modules/.cache/storybook/10.5.8/52cc48694c62608288b0000be341d00786083203ddc6f6e820f3e2a0eddc9703/sb-vitest/vitest/f8437193862b78daa12ee0660971b8b868a1e776/deps/plugins.Cigb0uSy-BHnOlFtn.js?v=092dcbd1:5564:6
❯ collectTests ../../node_modules/.cache/storybook/10.5.8/52cc48694c62608288b0000be341d00786083203ddc6f6e820f3e2a0eddc9703/sb-vitest/vitest/f8437193862b78daa12ee0660971b8b868a1e776/deps/plugins.Cigb0uSy-BHnOlFtn.js?v=092dcbd1:5546:3
❯ startTests ../../node_modules/.cache/storybook/10.5.8/52cc48694c62608288b0000be341d00786083203ddc6f6e820f3e2a0eddc9703/sb-vitest/vitest/f8437193862b78daa12ee0660971b8b868a1e776/deps/plugins.Cigb0uSy-BHnOlFtn.js?v=092dcbd1:6221:17
Caused by: Caused by: TypeError: Failed to fetch dynamically imported module: http://localhost:63318/home/runner/work/element-web/element-web/packages/shared-components/.storybook/vitest.setup.ts?import&browserv=1790884051144
Test Files 3 failed | 337 passed | 4 skipped (344)
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/3]⎯
FAIL @element-hq/web-shared-components (unit) (chromium) src/core/viewmodel/tests/Snapshot.test.ts [ packages/shared-components/src/core/viewmodel/tests/Snapshot.test.ts ]
FAIL @element-hq/web-shared-components (unit) (chromium) src/room-list/VirtualizedRoomListView/RoomListItemWrapper/RoomListItemView/NotificationDecoration.test.tsx [ packages/shared-components/src/room-list/VirtualizedRoomListView/RoomListItemWrapper/RoomListItemView/NotificationDecoration.test.tsx ]
Error: Failed to import test file /home/runner/work/element-web/element-web/packages/shared-components/src/test/setupTests.ts
❯ runSetupFiles node_modules/.vite/vitest/0df9eea0bad5a55395db9ec290dfcf4a883d5d3e/deps/plugins.Cigb0uSy-BHnOlFtn.js?v=a3abf472:5536:35
❯ node_modules/.vite/vitest/0df9eea0bad5a55395db9ec290dfcf4a883d5d3e/deps/plugins.Cigb0uSy-BHnOlFtn.js?v=a3abf472:5564:6
❯ collectTests node_modules/.vite/vitest/0df9eea0bad5a55395db9ec290dfcf4a883d5d3e/deps/plugins.Cigb0uSy-BHnOlFtn.js?v=a3abf472:5546:3
❯ startTests node_modules/.vite/vitest/0df9eea0bad5a55395db9ec290dfcf4a883d5d3e/deps/plugins.Cigb0uSy-BHnOlFtn.js?v=a3abf472:6221:17
Caused by: Caused by: TypeError: Failed to fetch dynamically imported module: http://localhost:63317/home/runner/work/element-web/element-web/packages/shared-components/src/test/setupTests.ts?import&browserv=1790884050237https://github.com/element-hq/element-web/actions/runs/36915092909/job/110546995962?pr=35293 https://github.com/element-hq/element-web/actions/runs/36915092909/job/110551799632?pr=35293 https://github.com/element-hq/element-web/actions/runs/36915092909/job/110561611467?pr=35293 https://github.com/element-hq/element-web/actions/runs/36915092909/job/110561611143?pr=35293
Looks like a possible reprise of https://github.com/element-hq/element-web/issues/33189?
Source: element-hq/element-web