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

ngc 5.X.X generates unused imports #8320

Closed
paulsouche opened this issue Nov 3, 2017 · 2 comments
Closed

ngc 5.X.X generates unused imports #8320

paulsouche opened this issue Nov 3, 2017 · 2 comments
Labels
needs: investigation Requires some digging to determine if action is needed P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful

Comments

@paulsouche
Copy link

paulsouche commented Nov 3, 2017

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/compiler-cli 5.0.0
node 8.6.0
npm 5.5.1
yarn 1.2.1
windows 10
ubuntu 17.10

Repro steps.

Use my repo

The log given by the failure.

No failure but problem with webpack later in the assets

Desired functionality.

ngc should not generate typings imports

Mention any other details that might be useful.

Hi,

I've noticed that since @angular/compiler 5.0.0 unused imports are generated.

Let's say I have a module 'my-module/types' exporting only interfaces and I import this module in an angular library. Previously in 4.X.X import {whatever} from 'my-module/types' were not generated by ngc. But now in 5.X.X, this is generated and unused. I don't think it's a typescript issue because if I run tsc compilation, it does not generate these imports.

ngc does not fail but I've issues when I import my module in webpack.

You can reproduce with my repo

Thanks anyway for the great job

EDIT

I have edited my repo and if we transpile like in angular@4 with annotationAs flags, imports are not generated. Hope it helps...

@filipesilva filipesilva added needs: investigation Requires some digging to determine if action is needed P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful labels Nov 3, 2017
@alan-agius4
Copy link
Collaborator

alan-agius4 commented Jan 4, 2019

Duplicate of angular/angular#21280

@alan-agius4 alan-agius4 marked this as a duplicate of angular/angular#21280 Jan 4, 2019
@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 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: investigation Requires some digging to determine if action is needed P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful
Projects
None yet
Development

No branches or pull requests

3 participants