Angular 11 Error in the latest 5.20203.748 Version

Posted by: james.ingham on 11 December 2020, 12:00 am EST

  • Posted 11 December 2020, 12:00 am EST - Updated 3 October 2022, 2:56 pm EST

    Dear Support,

    Just tested the new Wijmo-5.20203.748 version. The release note says it supports Angular 11:

    https://www.grapecity.com/blogs/wijmo-v3-has-landed

    However when I tried it in a small Angular 11 project. I encountered many TS2416 errors:

    Build at: 2020-12-11T03:46:32.917Z - Hash: e4db7ab4c977e31025c7 - Time: 5077ms
    
    Error: node_modules/wijmo/wijmo.d.ts:3277:5 - error TS2416: Property 'filter' in type 'CollectionView<T>' is not assignable to the same property in base type 'IEditableCollectionView'.
      Type 'IPredicate<any> | null' is not assignable to type 'IPredicate<any>'.
        Type 'null' is not assignable to type 'IPredicate<any>'.
    
    3277     filter: IPredicate | null;
             ~~~~~~
    node_modules/wijmo/wijmo.d.ts:3277:5 - error TS2416: Property 'filter' in type 'CollectionView<T>' is not assignable to the same property in base type 'IPagedCollectionView'.
      Type 'IPredicate<any> | null' is not assignable to type 'IPredicate<any>'.
        Type 'null' is not assignable to type 'IPredicate<any>'.
    
    3277     filter: IPredicate | null;
             ~~~~~~
    node_modules/wijmo/wijmo.d.ts:3358:14 - error TS2416: Property 'currentChanged' in type 'CollectionView<T>' is not assignable to the same property in base type 'IEditableCollectionView'.
      Type 'Event<CollectionView<T>, EventArgs>' is not assignable to type 'Event<ICollectionView<any>, EventArgs>'.
        Type 'CollectionView<T>' is not assignable to type 'ICollectionView<any>'.
          Types of property 'filter' are incompatible.
            Type 'IPredicate<any> | null' is not assignable to type 'IPredicate<any>'.
              Type 'null' is not assignable to type 'IPredicate<any>'.
    

    My package.json is:

    
      "dependencies": {
        "@angular/animations": "~11.0.4",
        "@angular/cdk": "^11.0.2",
        "@angular/common": "~11.0.4",
        "@angular/compiler": "~11.0.4",
        "@angular/core": "~11.0.4",
        "@angular/flex-layout": "^11.0.0-beta.33",
        "@angular/forms": "~11.0.4",
        "@angular/platform-browser": "~11.0.4",
        "@angular/platform-browser-dynamic": "~11.0.4",
        "@angular/router": "~11.0.4",
        "@circlon/angular-tree-component": "^10.0.0",
        "ng2-dnd": "github:pungiish/ng2-dnd#master",
        "ng2-file-upload": "^1.4.0",
        "wijmo": "file:other-vendors/wijmo-commonjs-748",
        "rxjs": "~6.6.0",
        "tslib": "^2.0.0",
        "zone.js": "~0.10.2"
      },
      "devDependencies": {
        "@angular-devkit/build-angular": "~0.1100.4",
        "@angular/cli": "~11.0.4",
        "@angular/compiler-cli": "~11.0.4",
        "@types/jasmine": "~3.6.0",
        "@types/node": "^12.11.1",
        "codelyzer": "^6.0.0",
        "jasmine-core": "~3.6.0",
        "jasmine-spec-reporter": "~5.0.0",
        "karma": "~5.1.0",
        "karma-chrome-launcher": "~3.1.0",
        "karma-coverage": "~2.0.3",
        "karma-jasmine": "~4.0.0",
        "karma-jasmine-html-reporter": "^1.5.0",
        "protractor": "~7.0.0",
        "ts-node": "~8.3.0",
        "tslint": "~6.1.0",
        "typescript": "~4.0.2"
      }
    
    

    My tsconfig.json file is:

    
    {
      "compileOnSave": false,
      "compilerOptions": {
        "baseUrl": "./",
        "outDir": "./dist/out-tsc",
        "forceConsistentCasingInFileNames": true,
        "strict": true,
        "noImplicitReturns": true,
        "noFallthroughCasesInSwitch": true,
        "sourceMap": true,
        "declaration": false,
        "downlevelIteration": true,
        "experimentalDecorators": true,
        "moduleResolution": "node",
        "importHelpers": true,
        "target": "es2015",
        "module": "es2020",
        "lib": [
          "es2018",
          "dom"
        ]
      },
      "angularCompilerOptions": {
        "strictInjectionParameters": true,
        "strictInputAccessModifiers": true,
        "strictTemplates": true
      }
    }
    
    

    Did we miss anything here?

  • Posted 11 December 2020, 2:13 am EST

    After suppressing the Typescript errors. I got more related to Angular Ivy compiler:

    This likely means that the library (wijmo/wijmo.angular2.grid.search) which declares WjGridSearchModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.
    
  • Posted 11 December 2020, 9:45 am EST

    Hey James, this is an easy fix.

    It looks like you are using our legacy “wijmo” package on npm. We still keep this updated, but it does not have the special module formatting to support Angular Ivy.

    Please migrate your application to use the scoped “@grapecity/wijmo…” packages.

    We have a convenient bundle you can install for angular like so:

    npm install @grapecity/wijmo.angular2.all
    

    And you will need to update some of your imports as well. Here is a blog about migrating from the “wijmo” to “@grapecity/wijmo…” packages. https://www.grapecity.com/blogs/wijmo-npm-package-changes

    And here is the standard documentation for using wijmo from npm which might also be helpful. https://www.grapecity.com/wijmo/docs/GettingStarted/Referencing-Wijmo-NPM

  • Posted 13 December 2020, 7:47 pm EST

    Thanks a lot Chris. I tried @grapecity version and it works with Angular 11. All good!

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels