1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

Angular testCases are failing with node_modules/moment/moment"' can only be default-imported...

Discussão em 'Angular' iniciado por Subburaj, Outubro 30, 2024 às 07:42.

  1. Subburaj

    Subburaj Guest

    My Angular application got compiled successfully, But Its failing while I run grunt karma:unit testcases with below error,

    node_modules/moment/moment"' can only be default-imported using the 'allowSyntheticDefaultImports' flag


    Even though I have added this entry in my tsconfig.json:

    "compilerOptions": {
    "allowJs": true,
    "baseUrl": "./",
    "outDir": "./dist",
    "sourceMap": true,
    "esModuleInterop": true,
    "declaration": false,
    "experimentalDecorators": true,
    "module": "es2020",
    "moduleResolution": "node",
    "allowSyntheticDefaultImports": true,
    "importHelpers": false,
    "target": "es6"
    }


    Please share your ideas.

    Continue reading...

Compartilhe esta Página