Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper fix for using both date-fns and luxon in same project #584

Open
fatso83 opened this issue Aug 16, 2021 · 1 comment
Open

Proper fix for using both date-fns and luxon in same project #584

fatso83 opened this issue Aug 16, 2021 · 1 comment

Comments

@fatso83
Copy link

fatso83 commented Aug 16, 2021

I inherited a TypeScript project that has not been compiling in a long time, it seems. One error deals with it having both date-fns and luxon in the same project, along with corresponding types, that seem to crash.

node_modules/@date-io/date-fns/type/index.d.ts:2:15 - error TS2300: Duplicate identifier 'DateType'.

2   export type DateType = Date;
                ~~~~~~~~

  node_modules/@date-io/luxon/type/index.d.ts:4:15
    4   export type DateType = DateTime;
                    ~~~~~~~~
    'DateType' was also declared here.

node_modules/@date-io/luxon/type/index.d.ts:4:15 - error TS2300: Duplicate identifier 'DateType'.

4   export type DateType = DateTime;
                ~~~~~~~~

  node_modules/@date-io/date-fns/type/index.d.ts:2:15
    2   export type DateType = Date;
                    ~~~~~~~~
    'DateType' was also declared here.

Aside from the fact that these two libraries are overlapping in functionality (and I should probably refactor to just have one), what is the proper fix here? My quick fix was simply to remove one of the offending files in node_modules, but that's hardly a proper solution ... (although it does the job when paired with patch-package)

@dmtrKovalenko
Copy link
Owner

It's a problem – we are not using this ephimeral type anymore and there is a PR #416 to remove support but it will require major upgrade which is hard to adopt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants