components icon indicating copy to clipboard operation
components copied to clipboard

Illegal state: Could not load the summary for directive ObserveContent

Open Splaktar opened this issue 9 years ago • 35 comments

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Angular Material and the CDK's latest release/master is compatible with Angular 5.0.0-rc.7+ and Angular CLI 1.5.0-rc.5+.

What is the current behavior?

Build fails with the following error:

ERROR in Error: Illegal state: Could not load the summary for directive ObserveContent in /Users/splaktar/Git/tf/webapp/node_modules/@angular/cdk/observers/typings/index.d.ts.

What are the steps to reproduce?

Unable to reproduce in Stackblitz. Closest I came was https://stackblitz.com/edit/angular-material-with-angular-v5 which gives no errors.

I was unable to get @angular/flex-layout to build since it requires a version from master or angular/flex-layout-builds which isn't accessible to Stackblitz (since not on NPM). I'm not having that problem in my local build.

What is the use-case or motivation for changing an existing behavior?

Dev and production builds passing.

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

Angular CLI: 1.5.0-rc.5
Node: 6.11.0
OS: darwin x64
Angular: 5.0.0-rc.7
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router
... service-worker

@angular/cdk: 2.0.0-beta.12-0ea4370
@angular/cli: 1.5.0-rc.5
@angular/flex-layout: 2.0.0-beta.9-99e7450
@angular/material: 2.0.0-beta.12-0ea4370
@angular-devkit/build-optimizer: 0.0.31
@angular-devkit/core: 0.0.20
@angular-devkit/schematics: 0.0.34
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.0-rc.5
@schematics/angular: 0.0.48
typescript: 2.4.2
webpack: 3.8.1

I also tried with CDK and material2 on beta.12.

Is there anything else we should know?

No

Splaktar avatar Oct 27 '17 07:10 Splaktar

I'm facing the same problem. any fix for this?

skytouch avatar Jan 13 '18 15:01 skytouch

I can't just remove "rootDir": "src", so any news how to fix this issue?

lubos-bistak avatar Feb 12 '18 13:02 lubos-bistak

Any progress on this? I have the same issue and not able to remove the rootdir

Aaltuj avatar Mar 01 '18 16:03 Aaltuj

Hi,

I have the same problem, a version for fix this is schedule?

My tsconfig.app.json:

{
  "extends": "../tsconfig.json",
  "compilerOptions": {
    "outDir": "../out-tsc/app",
    "baseUrl": "./",
    "module": "es2015",
    "types": [
      "node",
      "jasmine",
      "core-js"
    ]
  },
  "exclude": [
    "test.ts",
    "**/*.spec.ts",
    "**/*.mock.ts",
    "**/*.stub.ts"
  ]
}

Error message on build:

ERROR in : Illegal state: Could not load the summary for directive CdkObserveContent in /home/manuel/public_html/winlassie-ihm/node_modules/@angular/cdk/observers/typings/index.d.ts.

  • Angular version: ^5.2.8
  • Angular material & cdk version: ^5.2.3

Thanks

Xen3r0 avatar Mar 15 '18 10:03 Xen3r0

No there is no progress on this issue. It is closed. No one is working on it.

You may want to post on StackOverflow first as this issue is generally caused by a misconfiguration of TypeScript in your specific application and not directly related to Angular Material.

If that is unsuccessful and you are sure that your TypeScript configuration is complete (and you've consulted the TypeScript docs), then please open a new issue with a Stackblitz or GitHub demo where the team can reproduce and debug the issue.

Splaktar avatar Mar 16 '18 06:03 Splaktar

I don't know, where this came from, but in my case it was a tsconfig problem:

I hat the following:

"skipTemplateCodeGen": true,

instead of:

"skipTemplateCodegen": true,

in "angularCompilerOptions" in tsconfig.lib.ts

probably got copied from somewhere by accident.

eydrian avatar Mar 20 '18 06:03 eydrian

I can confirm that setting skipTemplateCodegen to true will make the error go away.

But this is because the error will only appear if skipTemplateCodegen is set to false.

$ grep skipTemplateCodegen node_modules/@angular -R
node_modules/@angular/compiler-cli/src/transformers/compiler_host.js:            // if skipTemplateCodegen is set and fullTemplateTypeCheck is not yet set,
node_modules/@angular/compiler-cli/src/transformers/compiler_host.js:            if (this.options.skipTemplateCodegen && !this.options.fullTemplateTypeCheck) {
node_modules/@angular/compiler-cli/src/transformers/api.d.ts:    skipTemplateCodegen?: boolean;
node_modules/@angular/compiler-cli/src/perform_compile.js:            if (options.skipTemplateCodegen) {
node_modules/@angular/compiler-cli/src/ngtools_api2.d.ts:    skipTemplateCodegen?: boolean;

While debugging I also ended up in transformers/compiler_host.js, but didn't find the actual reason for failure yet.

rhalff avatar Apr 26 '18 18:04 rhalff

I have also ran into this issue when I installed one npm package called 'ng-pick-datetime'. I managed to solve this issue by adding these two paths in include array of tsconfig.json:

{
  "compileOnSave": false,
  "include": ["node_modules/ng-pick-datetime/node_modules/@angular/cdk/**/typings/index.d.ts", "node_modules/@angular/cdk/**/typings/index.d.ts", "src/**/*.ts"],
  "exclude": ["**/*.spec.ts"],
  "compilerOptions": {
       ........
  }
}

So I think it can fix the issue.

HarshMathur avatar Jul 13 '18 09:07 HarshMathur

any other solves? editing the json doesn't work for me

ghost avatar Oct 22 '18 11:10 ghost

Same by @hansl . I have this issue with CdkAriaLive:

ERROR in : Illegal state: Could not load the summary for directive CdkAriaLive in ...../node_modules/@angular/cdk/a11y/typings/index.d.ts.

I tried to modify tsconfig.

csaszika avatar Feb 15 '19 12:02 csaszika

I don't have the 'rootDir' option in 'tsconfig.json', I tried to add ,But there is still this mistake. Then I tried

ng build

Instead of ng build --prod It helps me.

Dyinfalse avatar Apr 24 '19 04:04 Dyinfalse

@csaszika please open a new issue with a reproduction. Go Pats!

Splaktar avatar Apr 25 '19 05:04 Splaktar

@Splaktar sorry for late answer, after some investigation I have created a new project with upgraded versions so with angular(7.2.13) and material(7.3.8) and I cannot reproduce the issue anymore. If I meet with the same issue, then I update my comment. Thanks for comments

csaszika avatar Apr 25 '19 07:04 csaszika

@HarshMathur Thank you for your solution , it really helps me a lot . I think default tsconfig.ts doesn't include those *.ts in node_modules document , since it doesn't have "files" and "includes" options.

WardLIN avatar Jun 05 '19 06:06 WardLIN

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.