TypeError: dayjs_1.default is not a function
See original GitHub issueWhen 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:
- Created 5 years ago
- Reactions:3
- Comments:37 (9 by maintainers)
Top 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 >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
Seems add
"esModuleInterop": true,
to tsconfig would solve this issue, but should a better way.Just released v1.8.4 to revert this change. Please remain using
in a TypeScript project.
And discussion still welcome