Importing moment into TypeScript project
I had the same issue and solved the problem in my project by adding allowSyntheticDefaultImports
: true in compilerOptions
in my tsconfig.json
file and then I used the syntax
import moment from 'moment';
Reference: "https://momentjs.com/docs/#/use-it/typescript/"
The correct syntax is:
import * as moment from 'moment';