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

Components with the same name (via alias) results in ngfactory with duplicate function implementations #19935

Closed
jelbourn opened this issue Oct 25, 2017 · 2 comments
Assignees
Labels
area: core Issues related to the framework runtime hotlist: components team Related to Angular CDK or Angular Material regression Indicates than the issue relates to something that worked in a previous version

Comments

@jelbourn
Copy link
Member

jelbourn commented Oct 25, 2017

Steps to reproduce

After this runs once, you can re-run ngc as:

./node_modules/.bin/ngc -p ./dist/packages/e2e-app/tsconfig-build.json

(gulp e2e will build all of the dependencies as well)

Expected

The e2e app compiles successfully (as with Angular 4)

Actual

ngc emits an error

e2e-app-module.ngfactory.ts(451,10): error TS2393: Duplicate function implementation.
e2e-app-module.ngfactory.ts(454,10): error TS2393: Duplicate function implementation.
e2e-app-module.ngfactory.ts(458,10): error TS2393: Duplicate function implementation.
e2e-app-module.ngfactory.ts(461,10): error TS2393: Duplicate function implementation.

The file e2e-app-module.ngfactory.ts is not written to the file system.

Commentary

E2eAppModule declares (and marks as entryComponents) two classes both called TestDialog. In the module file, they are imported like:

import {TestDialog} from './dialog/dialog-e2e';
import {TestDialog as TestDialogFullScreen} from './fullscreen/fullscreen-e2e';

Renaming one of them resolves the error.

cc @tbosch @chuckjaz @crisbeto

@jelbourn jelbourn added area: core Issues related to the framework runtime hotlist: angular-core-team hotlist: components team Related to Angular CDK or Angular Material regression Indicates than the issue relates to something that worked in a previous version labels Oct 25, 2017
@tbosch tbosch self-assigned this Oct 26, 2017
@tbosch
Copy link
Contributor

tbosch commented Oct 26, 2017

This seems to be related to having noEmitOnError = false in the tsconfig.json. If I remove it, everything is fine. Will create a PR to fix this.

tbosch added a commit to tbosch/angular that referenced this issue Oct 26, 2017
This prevents errors reported against `.ngfactory.ts` files show up
as the result of running `ngc`.

Closes angular#19935
@matsko matsko closed this as completed in 18e9d86 Oct 27, 2017
matsko pushed a commit that referenced this issue Oct 27, 2017
…#19953)

This prevents errors reported against `.ngfactory.ts` files show up
as the result of running `ngc`.

Closes #19935
PR Close #19953
@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 Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: core Issues related to the framework runtime hotlist: components team Related to Angular CDK or Angular Material regression Indicates than the issue relates to something that worked in a previous version
Projects
None yet
Development

No branches or pull requests

2 participants