akveo / ngx-admin

Customizable admin dashboard template based on Angular 10+
https://akveo.github.io/ngx-admin/
MIT License
25.14k stars 7.95k forks source link

Compilation errors: [Symbol.iterator](), implicit 'any' type, #5547

Open matiasmagni opened 4 years ago

matiasmagni commented 4 years ago

Issue type

I'm submitting a ... (check one with "x")

Issue description

Current behavior: When I'm trying to compile the app I'm getting this error after installing AWS libraries:

ERROR in src/app/@core/core.module.ts(67,6): error TS2488: Type 'undefined' must have a '[Symbol.iterator]()' method that returns an iterator.
src/app/@core/core.module.ts(69,6): error TS2488: Type 'undefined' must have a '[Symbol.iterator]()' method that returns an iterator.
src/app/@theme/theme.module.ts(81,12): error TS2488: Type 'undefined' must have a '[Symbol.iterator]()' method that returns an iterator.
src/app/pages/editors/ckeditor/ckeditor.loader.ts(1,1): error TS7017: Element implicitly has an 'any' type because type 'Window' has no index signature.

Expected behavior: Expected behavior is to have a clean compilation and the app running.

Steps to reproduce: Install the following libraries:

Related code: One of the supposed iterator errors is in here:

export const NB_CORE_PROVIDERS: any = [
  ...MockDataModule.forRoot().providers,
  ...DATA_SERVICES,
  ...NbAuthModule.forRoot(<NbAuthOptions> {
    strategies: [
      NbDummyAuthStrategy.setup({
        name: 'email',
        delay: 3000,
      }),
    ],
    forms: {
      login: {
        socialLinks: socialLinks,
      },
      register: {
        socialLinks: socialLinks,
      },
    },
  }).providers,

  NbSecurityModule.forRoot({
    accessControl: {
      guest: {
        view: '*',
      },
      user: {
        parent: 'guest',
        create: '*',
        edit: '*',
        remove: '*',
      },
    },
  }).providers,

  {
    provide: NbRoleProvider, useClass: NbSimpleRoleProvider,
  },
  AnalyticsService,
  LayoutService,
  PlayerService,
  StateService,
];

Other information:

This is my package.json file:

{
  "name": "ngx-admin",
  "version": "4.0.1",
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/akveo/ngx-admin.git"
  },
  "bugs": {
    "url": "https://github.com/akveo/ngx-admin/issues"
  },
  "scripts": {
    "ng": "ng",
    "conventional-changelog": "conventional-changelog",
    "start": "ng serve",
    "build": "ng build",
    "build:prod": "npm run build -- --prod --aot",
    "test": "ng test",
    "test:coverage": "rimraf coverage && npm run test -- --code-coverage",
    "lint": "ng lint",
    "lint:fix": "ng lint ngx-admin-demo --fix",
    "lint:styles": "stylelint ./src/**/*.scss",
    "lint:ci": "npm run lint && npm run lint:styles",
    "pree2e": "webdriver-manager update --standalone false --gecko false",
    "e2e": "ng e2e",
    "docs": "compodoc -p src/tsconfig.app.json -d docs",
    "docs:serve": "compodoc -p src/tsconfig.app.json -d docs -s",
    "prepush": "npm run lint:ci",
    "release:changelog": "npm run conventional-changelog -- -p angular -i CHANGELOG.md -s"
  },
  "dependencies": {
    "@agm/core": "^1.0.0-beta.5",
    "@angular/animations": "^8.0.0",
    "@angular/cdk": "^8.0.0",
    "@angular/common": "^8.0.0",
    "@angular/compiler": "^8.0.0",
    "@angular/core": "^8.0.0",
    "@angular/forms": "^8.0.0",
    "@angular/platform-browser": "^8.0.0",
    "@angular/platform-browser-dynamic": "^8.0.0",
    "@angular/router": "^8.0.0",
    "@asymmetrik/ngx-leaflet": "3.0.1",
    "@aws-amplify/analytics": "^1.3.2",
    "@aws-amplify/api": "^1.2.2",
    "@aws-amplify/auth": "^1.4.2",
    "@aws-amplify/core": "^1.2.2",
    "@aws-amplify/pubsub": "^1.2.2",
    "@aws-amplify/storage": "^1.2.2",
    "@aws-amplify/ui": "^1.1.2",
    "@nebular/auth": "4.4.0",
    "@nebular/eva-icons": "4.4.0",
    "@nebular/security": "4.4.0",
    "@nebular/theme": "^4.4.0",
    "@swimlane/ngx-charts": "^10.0.0",
    "@types/aws-sdk": "^2.7.0",
    "@types/echarts": "^4.1.15",
    "angular-tree-component": "7.2.0",
    "angular2-chartjs": "0.4.1",
    "angular2-toaster": "^7.0.0",
    "apollo-angular": "^1.8.0",
    "apollo-angular-link-http": "^1.9.0",
    "apollo-cache-inmemory": "^1.6.3",
    "apollo-client": "^2.6.4",
    "apollo-link": "^1.2.13",
    "aws-amplify": "^1.2.2",
    "aws-amplify-angular": "^3.1.2",
    "aws-sdk": "aws/aws-sdk-js",
    "bootstrap": "4.3.1",
    "chart.js": "2.7.1",
    "ckeditor": "4.7.3",
    "classlist.js": "1.1.20150312",
    "core-js": "2.5.1",
    "echarts": "^4.4.0",
    "echarts-gl": "^1.1.1",
    "eva-icons": "^1.1.0",
    "graphql": "^14.5.8",
    "graphql-tag": "^2.10.1",
    "intl": "1.2.5",
    "ionicons": "2.0.1",
    "leaflet": "1.2.0",
    "nebular-icons": "1.1.0",
    "ng2-ckeditor": "^1.2.2",
    "ng2-completer": "2.0.8",
    "ng2-smart-table": "1.3.5",
    "ngx-charts": "^3.0.2",
    "ngx-color-picker": "^8.2.0",
    "ngx-echarts": "^4.2.1",
    "node-sass": "^4.12.0",
    "normalize.css": "6.0.0",
    "pace-js": "1.0.2",
    "roboto-fontface": "0.8.0",
    "rxjs": "6.5.3",
    "rxjs-compat": "6.3.0",
    "socicon": "3.0.5",
    "tinymce": "4.5.7",
    "tslib": "^1.9.0",
    "typeface-exo": "0.0.22",
    "web-animations-js": "github:angular/web-animations-js#release_pr208",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.800.2",
    "@angular/cli": "^8.0.2",
    "@angular/compiler-cli": "^8.0.0",
    "@angular/language-service": "8.0.0",
    "@compodoc/compodoc": "1.0.1",
    "@fortawesome/fontawesome-free": "^5.2.0",
    "@types/d3-color": "1.0.5",
    "@types/googlemaps": "^3.30.4",
    "@types/jasmine": "2.5.54",
    "@types/jasminewd2": "2.0.3",
    "@types/leaflet": "1.2.3",
    "@types/node": "^12.11.1",
    "codelyzer": "^5.0.1",
    "conventional-changelog-cli": "1.3.4",
    "husky": "0.13.3",
    "jasmine-core": "2.6.4",
    "jasmine-spec-reporter": "4.1.1",
    "karma": "1.7.1",
    "karma-chrome-launcher": "2.1.1",
    "karma-cli": "1.0.1",
    "karma-coverage-istanbul-reporter": "1.3.0",
    "karma-jasmine": "1.1.0",
    "karma-jasmine-html-reporter": "0.2.2",
    "npm-run-all": "4.0.2",
    "protractor": "5.1.2",
    "rimraf": "2.6.1",
    "stylelint": "7.13.0",
    "ts-node": "3.2.2",
    "tslint": "^5.7.0",
    "tslint-language-service": "^0.9.9",
    "typescript": "3.4.5"
  }
}
ptesser commented 4 years ago

@matiasmagni Hi, I have a similar issue. I think it's due to strict compiler options flags in tsconfig.json.

In my case a simple fix it's:

  ...NbAuthModule.forRoot({

    strategies: [
      NbDummyAuthStrategy.setup({
        name: 'email',
        delay: 3000,
      }),
    ],
    forms: {
      login: {
        socialLinks: socialLinks,
      },
      register: {
        socialLinks: socialLinks,
      },
    },
  }).providers || [], // Add --> || []

I hope this will help you.

Best Regards