No types available for redux/es/redux.mjs
Prior Issues
https://github.com/reduxjs/redux/pull/3143
What is the current behavior?
redux/es/redux.mjs does not have any associated typings.
Steps to Reproduce
Import redux/es/redux.mjs in a TypeScript file:
import {createStore} from 'redux/es/redux.mjs';
tsc reports:
Could not find a declaration file for module 'redux/es/redux.mjs'.
What is the expected behavior?
No error and types are found.
Environment Details
Hmm. Why does TS not pick up the types file from the typings key as always?
Tbh everything related to use of ESM as a delivery mechanism still confuses me at this point :(
ESM support is coming, but is only in the experimental builds at the moment: https://www.typescriptlang.org/docs/handbook/esm-node.html
tsc doesn't know that /es/index.mjs is related to the types exported in package.json. I think you can just put an index.d.ts file next to index.mjs and it'll be picked up.
This should be fixed in the 5.0 alphas, I think.