Open Bielousov opened 3 months ago
It appears that changing "moduleResolution" to nodenext
, node16
or bundler
fixes the import issue, although this isn't an option for me unfortunately. Also this wasn't the case in date-fns-tz@v1.3.7
, nor it is mentioned in documentation anywhere, nor used in the library own tsconfig.
Potentially related issue: https://github.com/marnusw/date-fns-tz/issues/291
Node: 18.20 (also tried 20.16) TypeScript: 5.4.4 tsconfig:
Upgrading from v1.3.7
When attempting to import any exported submodule directly, e.g:
TS cannot resolve the path, even though it is listed in the
date-fns-tz/package.json
:Changing this to
import { format } from 'date-fns-tz';
works, but it increases the bundle size significantly.Consider exporting type declarations: https://stackoverflow.com/a/77566206 along with ems and commonjs modules.