question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Upgrade leads to 'Cannot augment module 'xxxx' with value exports because it resolves to a non-module entity

See original GitHub issue

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.
...

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:14
  • Comments:18 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
MikeMitterercommented, Jul 13, 2021

Still struggling with this lib.

One thing that helps is:

yarn why date-fns

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

5reactions
MikeMitterercommented, Sep 24, 2020

@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

import { differenceInSeconds, fromUnixTime } from 'date-fns'
import { formatISO9075 } from 'date-fns'

Works only with 2.11.1

import { formatISO, parseISO, toDate } from 'date-fns';
import { isSameDay, sub } from 'date-fns'

In both modules I remove unnecessary locales with

        // Weitere Infos: https://date-fns.org/docs/webpack
        new webpack.ContextReplacementPlugin(
            /date\-fns[\/\\]/,
            new RegExp(`[/\\\\\](${supportedLocales.join('|')})[/\\\\\]`)
        ),
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix date-fns errors after package upgrade in Angular ...
Error message: Cannot augment module 'xxxx' with value exports because it resolves to a non-module entity. angular · node-modules · date-fns ...
Read more >
Troubleshoot Azure IoT Edge common errors - Microsoft Learn
Use this article to identify and resolve common issues when using IoT Edge solutions. If you need information on how to find logs...
Read more >
Learning the Basics - Gradle User Manual
If Gradle finds a module descriptor in a particular repository, it will attempt to download all of the artifacts for that module from...
Read more >
Overview - TypeScript
To allow differentiation between returned values and yielded values, ... But non-module global scripts cannot access types declared in modules.
Read more >
Bug listing with status RESOLVED with resolution TEST ...
Bug:233 - "Emacs segfaults when merged through the sandbox. ... "pppd cannot find ppp as a module in kernel 2.6.x" status:RESOLVED resolution:TEST-REQUEST ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found