<!-- * Please fill out this template with all the relevant information so we can understand what's going on and fix the issue. We appreciate bugs filed and PRs submitted! * If your issue is regarding one of the query APIs (`getByText`, `getByLabelText`, etc), then please file it on the `dom-testing-library` repository instead. If you file it here it will be closed. Thanks :) * Please make sure that you are familiar with and follow the Code of Conduct for this project (found in the CODE_OF_CONDUCT.md file). We'll probably ask you to submit the fix (after giving some direction). If you've never done that before, that's great! Check this free short video tutorial to learn how: http://kcd.im/pull-request --> - `@testing-library/react` version: not relevant - Testing Framework and version: not relevant <!-- are you using jest, mocha, puppeteer, ava? And what version? --> - DOM Environment: not relevant <!-- If you're using jsdom (the default with jest), what version? Otherwise, what browser and version are you running tests in? --> <!-- Keep in mind that if you're using a version of node we don't support that could also be an issue. Check our package.json file "engines" config for the supported version. Also keep in mind that if you're using a version of react we don't support that could be an issue. Check our package.json file "peerDependencies" config for the supported version. --> ### Relevant code or config: See reproduction ### What happened: ``` Property 'setup' does not exist on type 'typeof import("file:///node_modules/@testing-library/user-event/dist/types/index")'. ``` ### Reproduction: https://www.typescriptlang.org/play?target=99&moduleResolution=99&module=100&jsx=0#code/JYWwDg9gTgLgBAVwM4FMoFEBuKB28BmUEIcA5AAIwpIzA4DmAtADbABGUAhlAJ4D0yNIxTY8pANwAoSYIyiYAOlQwEYABQBKcUA ### Problem description: Incorrect types are causing errors when using TypeScript with `moduleResolution` set to `node16` or `nodenext`. This is confirmed by Are The Types Wrong, which shows that "Import resolved to a CommonJS type declaration file, but an ESM JavaScript file.": https://arethetypeswrong.github.io/?p=%40testing-library%2Fuser-event%4014.4.3 ### Suggested solution: Rather than shipping one set of types, separately from the codebase, ship types alongside of cjs and esm code. Not sure if this will help, but @testing-library/react does not have this problem: https://arethetypeswrong.github.io/?p=%40testing-library%2Freact%4014.0.0 And I can confirm that IRL.