Angular 10 typescript 3.9 npm run test failing for moment import

276 views Asked by At

I am using Angular v10.0.3 and typescript v 3.9.7. When i run npm run test:cii get the following. I am using import moment from 'moment' in my components and services. Also enabled the 'allowSyntheticDefaultImports' flag in my tsconfig.app.json

"compilerOptions": {
        "esModuleInterop": true,
        "allowSyntheticDefaultImports": true,  
}

Can anyone help to resolve this error?

export = moment;
        ~~~~~~~~~~~~~~~~
    This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag. 
client/app/shared/services/util.service.ts:3:8 - error TS1259: Module '"E:/Dev/TPS-Web/Src/OPUS/node_modules/moment/ts3.1-typings/moment"' can only be default-imported using the 'allowSyntheticDefaultImports' flag

Thanks

0

There are 0 answers