question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ERROR in CdkTableModule is not an NgModule

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5

github_iconTop GitHub Comments

66reactions
jymdmancommented, Aug 1, 2017

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

14reactions
CopperGiraffecommented, Aug 1, 2017

@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';

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unexpected module 'CdkTableModule' declared by the ...
CdkTableModule goes in the imports array because it is a module, and not a component.
Read more >
NgModules - Angular
NgModules configure the injector and the compiler and help organize related things together. An NgModule is a class marked by the @NgModule decorator....
Read more >
can't bind to 'matautocomplete' since it isn't a known property ...
If 'mat-option' is a Web Component then add 'CUSTOMELEMENTSSCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("utocomplete]="auto" ...
Read more >
angular/material2 - Gitter
Good evening, I'm getting the following error when trying the example: Uncaught Error: Template parse errors: Can't bind to 'dataSource' since it isn't...
Read more >
Tried to find bootstrap code, but could not specify either ...
input-form-example'; import {HttpModule} from '@angular/http'; import {CdkTableModule} from '@angular/cdk'; @NgModule({ exports: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found