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.

plugin(moment): Module "moment" has no default export.

See original GitHub issue

Bug Report

Using moment 2.24.0 I get a typescript error:

ERROR in node_modules/@fullcalendar/moment/main.d.ts(2,12): error TS1192: Module '"***/node_modules/moment/moment"' has no default export.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
arshawcommented, Apr 1, 2019

In order to get moment to work in an ES6 module setup, with typescript at least, you need to set allowSyntheticDefaultImports. see: https://github.com/moment/moment/issues/4397#issuecomment-358218964

Can you try that?

If that’s your problem, I will modify the docs to nudge people to do this

0reactions
arshawcommented, Aug 10, 2019

This was fixed in 4.3.0 though please start using 4.3.1 Releases: https://github.com/fullcalendar/fullcalendar/releases

Read more comments on GitHub >

github_iconTop Results From Across the Web

Importing moment into TypeScript project - Stack Overflow
@Ozrix No it doesn't. It means that none of the exports are defined as default, so you need to tell it what you...
Read more >
error TS1192: Module has no default export [Solved] - SPGuides
In this reactjs tutorial, we will discuss how to fix an error, error TS1192: Module has no default export. The solution will fix...
Read more >
Module has no exported member error in TypeScript
The error "Module has no exported member" occurs when we try to import a member that doesn't exist in the specified module. To...
Read more >
TSConfig Option: allowSyntheticDefaultImports - TypeScript
This option brings the behavior of TypeScript in-line with Babel, where extra code is emitted to make using a default export of a...
Read more >
Docs - Moment.js
Note: From version 2.9.0 moment exports itself as an anonymous module, so if you're using only the core (no locales / plugins), then...
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