I am working on this but it is hard to come up with one that is simple and useful for you.
Prerequisites
work in progress
Expected behavior
I can bundle @testing-library/user-event with Vite.
Actual behavior
In /src/utils/misc/getWindow.ts#L3 you are importing getWindowFromNode from @testing-library/dom. It seems like the compiler does some over optimisations which causes getWindow.ts to import from the CJS artifact of @testing-library/dom:
Reproduction example
I am working on this but it is hard to come up with one that is simple and useful for you.
Prerequisites
work in progress
Expected behavior
I can bundle
@testing-library/user-event
with Vite.Actual behavior
In
/src/utils/misc/getWindow.ts#L3
you are importinggetWindowFromNode
from@testing-library/dom
. It seems like the compiler does some over optimisations which causesgetWindow.ts
to import from the CJS artifact of@testing-library/dom
:(from NPM)
This is currently causing me headaches to support
@testing-library/user-event
in WebdriverIO component tests as it fails due to:Similar observations can be made for:
/@testing-library/user-event/dist/esm/event/eventMap.js
importingimport { eventMap as eventMap$1 } from '@testing-library/dom/dist/event-map.js';
User-event version
latest
Environment
Testing Library framework:
JS framework:
Test environment:
DOM implementation:
Additional context
No response