Duplicate variables in types (Cannot redeclare block-scoped variable 'daysInWeek')
See original GitHub issueSeems that in master the typings.d.ts has duplicate declared variables for daysInWeek (Line 1197)
`error TS2451: Cannot redeclare block-scoped variable ‘daysInWeek’.
1195 const daysInWeek: number`
https://github.com/date-fns/date-fns/blob/master/typings.d.ts#L1197
Was introduced by the commit https://github.com/date-fns/date-fns/commit/6d8e424021f31edacc46b8b55a823fa3b54cc08c
Issue Analytics
- State:
- Created a year ago
- Reactions:7
- Comments:11 (1 by maintainers)
Top Results From Across the Web
[SOLVED] Cannot Redeclare Block-Scoped Variable in ...
The “Cannot redeclare block-scoped variable” error occurs if you declare a variable with a name that clashes with one declared in TypeScript ...
Read more >Cannot redeclare block scoped variable - Stack Overflow
1. How about this - let co_module = require("co"); I faced something similar and this solved the error. · 2. This seems to...
Read more >Cannot redeclare block-scoped variable in TypeScript
The error "Cannot redeclare block-scoped variable" occurs when we redeclare a variable in the same block or when TypeScript uses global typings, which...
Read more >[v2.22.0] Typing issue: Cannot redeclare block-scoped ...
Hello @kossnocorp, in the v2.22.0 release, there are duplicates of daysInWeek and minTime in typings.d.ts that create issues with TypeScript.
Read more >ES2015 Block Scope Variables - Adobe Tech Blog
This means you can refer to a variable before it has been lexically declared, and JavaScript won't complain. It also means that you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
confirmed in version 2.29.0, this also exists.
Good one.
@leshakoss @tan75 there is a missing
@name
jsdoc in the constants file. Pretty sure that’s the root cause here, it’s happened before.https://github.com/date-fns/date-fns/blob/6d8e424021f31edacc46b8b55a823fa3b54cc08c/src/constants/index.ts#L11-L21