Components: ERROR in CdkTableModule is not an NgModule

Created on 1 Aug 2017  路  5Comments  路  Source: angular/components

Bug, feature request, or proposal:

Bug

What is the expected behavior?

I should be able to build the project normally

What is the current behavior?

I used to work on my project on the same device, but since I've changed, I'm getting an error with @angular/cdk

What are the steps to reproduce?

Here is my package.json dependencies

  "devDependencies": {
    "@angular/compiler-cli": "^4.0.0-beta.6",
    "@types/jasmine": "2.5.53",
    "@types/node": "^8.0.17",
    "@angular/cli": "*",
    "codelyzer": "~3.1.2",
    "concurrently": "^3.4.0",
    "jasmine-core": "2.7.0",
    "jasmine-spec-reporter": "4.1.1",
    "karma": "1.7.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-cli": "^1.0.1",
    "karma-jasmine": "^1.0.2",
    "karma-remap-istanbul": "^0.6.0",
    "live-server": "^1.2.0",
    "protractor": "~5.1.2",
    "ts-node": "3.3.0",
    "tslint": "^5.4.3",
    "typescript": "~2.4.2"
  },
"dependencies": {
    "@angular/animations": "^4.2.2",
    "@angular/cdk": "git+https://github.com/angular/cdk-builds.git",
    "@angular/material": "git+https://github.com/angular/material2-builds.git",
    "@angular/common": "^4.2.2",
    "@angular/compiler": "^4.2.2",
    "@angular/core": "^4.2.2",
    "@angular/forms": "^4.2.2",
    "@angular/http": "^4.2.2",
    "@angular/platform-browser": "^4.2.2",
    "@angular/platform-browser-dynamic": "^4.2.2",
    "@angular/router": "^4.2.2",
    "@toverux/ngsweetalert2": "^1.2.2",
    "angular2-notifications": "^0.7.4",
    "bootstrap": "^3.3.6",
    "core-js": "^2.4.1",
    "es6-shim": "^0.35.0",
    "font-awesome": "^4.6.1",
    "hammerjs": "^2.0.8",
    "jquery": "^3.2.1",
    "jsoneditor": "^5.7.2",
    "jsonpath": "^0.2.11",
    "lodash": "^4.17.4",
    "ng2-jsoneditor": "^0.1.1",
    "ngx-bootstrap": "*",
    "rdash-ui": "^1.0.1",
    "reflect-metadata": "0.1.10",
    "rxjs": "^5.4.0",
    "systemjs": "0.20.17",
    "ts-helpers": "^1.1.1",
    "zone.js": "^0.8.12"
  }

I'm mostly suprised because it used to work

When I try to build the project using npm start I'm getting the following errors:

WARNING in ./src/app/app.module.ts
91:31-45 "export 'CdkTableModule' was not found in '@angular/cdk'

ERROR in ./src/app/app.module.ts (7,10): Module '"./node_modules/@angular/cdk/cdk"' has no exported member 'CdkTableModule'.

ERROR in CdkTableModule is not an NgModule
webpack: Failed to compile.

It goes the same for DataSource

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Tested on Ubuntu, last version of Angular and Material

Thanks in advance

Most helpful comment

You need to change your imports to import from @angular/cdk/table instead.

All 5 comments

You need to change your imports to import from @angular/cdk/table instead.

@jymdman Thanks a lot!
Perhaps the official documentation should be updated:
https://material.angular.io/guide/cdk-table
import {DataSource} from '@angular/cdk'; --> import {DataSource} from '@angular/cdk/table';

This is something that isn't released in official release yet, only in snapshot.
I'm sure they will update when they release next beta.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings