date-fns: Upgrade leads to 'Cannot augment module 'xxxx' with value exports because it resolves to a non-module entity
If I run tsc --noEmit --incremental false I get a long list of Cannot augment... error messages.
Everything was fine with 2.10.0 but fails now with 2.11.0
...
node_modules/date-fns/typings.d.ts:15311:9 - error TS2649: Cannot augment module 'ro' with value exports because it resolves to a non-module entity.
15311 const ro: Locale
~~
node_modules/date-fns/typings.d.ts:15314:9 - error TS2649: Cannot augment module 'ru' with value exports because it resolves to a non-module entity.
15314 const ru: Locale
~~
node_modules/date-fns/typings.d.ts:15317:9 - error TS2649: Cannot augment module 'sk' with value exports because it resolves to a non-module entity.
...
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 15
- Comments: 18 (2 by maintainers)
Still struggling with this lib.
One thing that helps is:
If yarn show multiple versions of date-fns you are f… Make sure you have the same version of date-fns for all!!! you packages
@dkozickis Can you please reopen this issue. As you can see the problem still exists. I tried it with 2.15.0 + 2.16.1 always the same problem. Only downgrading to 2.11.1. helps
I use date-fns in several modules. In some 2.16.1 works in others it fails. Works with 2.16.1
Works only with 2.11.1
In both modules I remove unnecessary locales with
I momentarily added this inside tsconfig.json
"skipLibCheck": true,I have this issue in version 2.15.0 . I am using this in Angular v9
import { format } from 'date-fns';I still have, too.so how can you solve it?
Same problem here
Downgrade to 2.11.1 didn’t work
P.S.: When using same version of date-fns in an ionic+stencil project, it seems to work fine. Maybe some issue with Angular?
I have this with date-fns 2.20.2, using typescript 4.2.3. In my project, the root of the repository has a package.json and contains frontend code, but the
/serverfolder has its own package.json and contains cloud functions. Both packages use date-fns and have their own copies installed.I’m getting around this by adding this to my CI, which is somewhat suboptimal
I still have this issue with imports from
date-fns/fp. Switching to non-fp fixes it.