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.

dayjs.locale() throws type error due to type update in v.1.8.30

See original GitHub issue

Describe the bug The locale() function used to accept a string up until v1.8.30, which updated the types to use LocalePresetType (https://github.com/iamkun/dayjs/commit/73813ab5851c118450f5d8fc15cae71d49d800ae). This has broken our CI/CD pipelines, as our i18n implementation returns the locale code as a string.

Expected behavior Patch versions should not include type changes that are not backwards compatible with previous versions.

Information

  • Day.js Version [1.8.30]
  • OS: [Ubuntu 16.04]
  • Browser [n/a]

suggestion Add back string as a valid type either in the function declarations or in the LocalePresetType union.

We can work around this issue by casting the string to a LocalePresetType but we would prefer if we didn’t have to do this everywhere our i18n interacts with dayjs.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
iamkuncommented, Jul 29, 2020

🎉 This issue has been resolved in version 1.8.31 🎉

The release is available on:

Your semantic-release bot 📦🚀

2reactions
iamkuncommented, Jul 27, 2020

This would be a good fix at this moment. https://github.com/iamkun/dayjs/pull/968

Read more comments on GitHub >

github_iconTop Results From Across the Web

iamkun/dayjs (Raised $1,326.00) - Issuehunt
dayjs.locale() throws type error due to type update in v.1.8.30. Unfunded#964created byB1rch. $0.00. How we can format the duration in dayjs.
Read more >
dayjs: Versions | Openbase
Full version history for dayjs including change logs. ... fix type error to add ordianl property in InstanceLocaleDataReturn and GlobalLocaleDataReturn ...
Read more >
umi怎么配置autoprefixer - CSDN
csdn已为您找到关于umi怎么配置autoprefixer相关内容,包含umi怎么配置autoprefixer相关文档代码介绍、相关教程视频课程,以及相关umi怎么配置autoprefixer问答内容。
Read more >
https://gitea.xndr.de/philipp/nixpkgs/commit/01c2b...
For example an option of type <literal>attrsOf str</literal> can be used for ... 1 then cfg.users else throw "GRUB version 1 does not...
Read more >
dayjs - dayjs.locale ()에서 v.1.8.30의 유형 업데이트로 인해 유형 오류 ...
에 만든 2020년 07월 22일 · 11코멘트 · 출처: iamkun/dayjs. 버그 설명 locale () 함수는 v1.8.30까지 문자열을 수락하는 데 사용되었으며 LocalePresetType ...
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