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.

TypeError: dayjs_1.default is not a function

See original GitHub issue

When updating the dayjs package from 1.8.0 to 1.8.3, I’m getting this error.

I changed my import from import * as dayjs from 'dayjs'; to import dayjs from 'dayjs'; which let me compile, but this error what this result.

Here is the line of code for the error:

const today = dayjs().format('YYYY-MM-DD');

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:37 (9 by maintainers)

github_iconTop GitHub Comments

97reactions
iamkuncommented, Feb 5, 2019

Seems add "esModuleInterop": true, to tsconfig would solve this issue, but should a better way.

57reactions
iamkuncommented, Feb 5, 2019

Just released v1.8.4 to revert this change. Please remain using

import * as dayjs from 'dayjs'

in a TypeScript project.

And discussion still welcome

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: (0 , dayjs_1.default) is not a function - Stack Overflow
dayjs does not export a default entry like that; use import * as dayjs from 'dayjs' to import all of it's exports (as...
Read more >
dayjs_1.default) is not a function - You.com | The AI Search ...
Your were trying to call diff () on a string (the output of dayjs ().format ()) rather than a Dayjs object. Here's how...
Read more >
TypeError: dayjs_1.default is not a function #1667 - Issuehunt
TypeError : dayjs_1.default is not a function #1667 ... Expected behavior For my tests to pass and not consider dayjs to not be...
Read more >
How to use the dayjs.default function in dayjs - Snyk
To help you get started, we've selected a few dayjs.default examples, ... event = sanitizeEvent(event); var startDate = dayjs_1.default(event.start) .
Read more >
[TypeScript] Error : _1.default is not a function - velog
Error. dayjs_1.default is not a function TypeError: dayjs_1.default is not a function. dayjs를 사용하기 위해 import 했을 때, 위와 같은 에러 ...
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