Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IVY][9.0.0] Renaming a directive in a consumed library built by ng-packagr causes error in Application when in watch mode #16920

Closed
1 task done
JonWallsten opened this issue Feb 10, 2020 · 2 comments · Fixed by #16992

Comments

@JonWallsten
Copy link

🐞 Bug report

Command (mark with an x)

  • build

Description

We are building a library with ng-packagr and then consuming it in our Angular 9 application.
When I renamed one of the exported directives used by the application I get an error causing rendering to skip the rest of the page.

image

image

🔬 Minimal Reproduction

As usual I can pr

ovide an example but it takes time. Let me know if it's needed.

🔥 Exception or Error


angular.js:31599 ERROR TypeError: Cannot read property 'ɵcmp' of undefined
    at getComponentDef (angular.js:29620)
    at extractDirectiveDef (angular.js:29446)
    at Array.map ()
    at def.directiveDefs (angular.js:29442)
    at createTView (angular.js:35363)
    at getOrCreateTComponentView (angular.js:35315)
    at addComponentLogic (angular.js:36046)
    at instantiateAllDirectives (angular.js:35890)
    at createDirectivesInstances (angular.js:35283)
    at ɵɵelementStart (angular.js:41965)

🌍 Your Environment


Angular CLI: 9.0.1
Node: 12.14.0
OS: win32 x64

Angular: 9.0.0
... animations, cdk, common, compiler, compiler-cli, core, forms
... material, platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.900.1
@angular-devkit/build-optimizer   0.900.1
@angular-devkit/core              9.0.1
@angular-devkit/schematics        9.0.1
@angular/cli                      9.0.1
@angular/http                     8.0.0-beta.10
@ngtools/webpack                  9.0.1
@schematics/angular               9.0.1
@schematics/update                0.900.1
rxjs                              6.5.4
typescript                        3.7.5
webpack                           4.41.5

Anything else relevant?

@JonWallsten JonWallsten changed the title [IVY][9.0.0] Renaming a directive in a consumed library built by ng-packagr causes error in Application [IVY][9.0.0] Renaming a directive in a consumed library built by ng-packagr causes error in Application when in watch mode Feb 10, 2020
@alan-agius4 alan-agius4 transferred this issue from angular/angular-cli Feb 10, 2020
@alan-agius4 alan-agius4 transferred this issue from angular/angular Feb 10, 2020
@ngbot ngbot bot modified the milestone: Backlog Feb 11, 2020
@filipesilva filipesilva modified the milestones: Backlog, 9.0.x Feb 11, 2020
@NazimMertBilgi
Copy link

Is there any improvement regarding the problem?

@alan-agius4 alan-agius4 self-assigned this Feb 13, 2020
kyliau pushed a commit that referenced this issue Feb 18, 2020
We now add non node_modules `.d.ts` as a dependency of the main chunk. This is important under Ivy, because NG metadata is now part of the declarations files ex:

```ts
export declare class FooComponent implements OnInit {
    constructor();
    ngOnInit(): void;
    static ɵfac: i0.ɵɵFactoryDef<FooComponent>;
    static ɵcmp: i0.ɵɵComponentDefWithMeta<FooComponent, "lib-foo", never, {}, {}, never>;
}
```

Previously such files were not being added as dependency and such files didn't get invalidated when changed.

Closes #16920 and closes #16921
kyliau pushed a commit that referenced this issue Feb 18, 2020
We now add non node_modules `.d.ts` as a dependency of the main chunk. This is important under Ivy, because NG metadata is now part of the declarations files ex:

```ts
export declare class FooComponent implements OnInit {
    constructor();
    ngOnInit(): void;
    static ɵfac: i0.ɵɵFactoryDef<FooComponent>;
    static ɵcmp: i0.ɵɵComponentDefWithMeta<FooComponent, "lib-foo", never, {}, {}, never>;
}
```

Previously such files were not being added as dependency and such files didn't get invalidated when changed.

Closes #16920 and closes #16921
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Mar 20, 2020
ikjelle pushed a commit to ikjelle/angular-cli that referenced this issue Mar 26, 2024
We now add non node_modules `.d.ts` as a dependency of the main chunk. This is important under Ivy, because NG metadata is now part of the declarations files ex:

```ts
export declare class FooComponent implements OnInit {
    constructor();
    ngOnInit(): void;
    static ɵfac: i0.ɵɵFactoryDef<FooComponent>;
    static ɵcmp: i0.ɵɵComponentDefWithMeta<FooComponent, "lib-foo", never, {}, {}, never>;
}
```

Previously such files were not being added as dependency and such files didn't get invalidated when changed.

Closes angular#16920 and closes angular#16921
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants