Exported types incompatible with ESM when using TypeScript@next
envgap__reactivex__rxjs-6801
01 / FAILURE SIGNATURE
As reported upstream
No identifying execution failure has been captured.
Not a benchmark task.
- In a clean container the reported failure did not reproduce, or the known fix did not make the project run.
02 / ENVIRONMENT RECIPE
- Base commit
123a0f256e0022e87dfa249c895670ee745def53- Manifest
package.json- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
reactivex/rxjs #6801 · read the original issue
### Describe the bug
When importing `rxjs` in a project using TypeScript@next with the `"module": "nodenext"` ([experimental ESM support](https://www.typescriptlang.org/docs/handbook/esm-node.html)) it fails to locate the associated types. As seen in this TypeScript playground: [Playground Link](https://www.typescriptlang.org/play?target=99&moduleResolution=99&ts=4.6.0-dev.20220116#code/JYWwDg9gTgLgBAbzgeQEYGcCmUBuBDVAG0wBo4BlAV1QCtMBjeAXzgDMoIQ4ByKADxrpuAbiA).
### Expected behavior
TypeScript@next is experimental so I suppose I don't expect it to work. But the API seems fairly stable, so I am raising this issue to track the change. The `exports` spec defines an optional `types` field, which if used in rxjs resolved the issue (I have tried this with a patch locally).
### Reproduction code
```typescript
import { Observable, Subject } from 'rxjs';
```
### Reproduction URL
https://www.typescriptlang.org/play?target=99&moduleResolution=99&ts=4.6.0-dev.20220116#code/JYWwDg9gTgLgBAbzgeQEYGcCmUBuBDVAG0wBo4BlAV1QCtMBjeAXzgDMoIQ4ByKADxrpuAbiA
### Version
7.4.0
### Environment
- Node.js@16.13.2
- TypeScript@4.6.0-dev.20220204
### Additional context
Related discussion in the TypeScript repo: https://github.com/microsoft/TypeScript/issues/46452#issuecomment-103156427904 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]