-
Notifications
You must be signed in to change notification settings - Fork 12k
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 marks unassigned but used child interfaces as unused with compiler warning. #15626
Comments
in my case, it complains about environment files WARNING in. .. ClientApp/src/environments/environment.dev.ts is part of the TypeScript compilation but it's unused. WARNING in ... ClientApp/src/environments/environment.prod.ts is part of the TypeScript compilation but it's unused. WARNING in D ...ClientApp/src/environments/environment.qa.ts is part of the TypeScript compilation but it's unused. |
I'm currently trying with v9 and it appears to have wiped out my excludes, which excluded the environment ts files that I didn't want and my wallaby setup. |
I have this same issue exactly as described above. interface Exception {
Identifier?: number;
Message: string;
CustomData?: any;
} Which has 13 references in the code e.g: const x = result.error as Exception;
var y: Exception;
func(): Observable<Exception> { } |
I did |
With Ivy v9 I don't need the excludes for environment. But even excluding the offending interfaces will not work. |
Hi all, For most cases you should update your {
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": []
},
"files": [
"src/main.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.d.ts"
]
} Note: that if you use |
Thank you for opening this and noting the workarounds! I am going to have to apply some of these to the update of material.angular.io. As @alan-agius4 said, updating your However, it won't solve the other issues where unassigned child interfaces are incorrectly marked as unused. |
We have a lot of warnings like mentioned in the issue.
In
Notice, that I have a hybrid application with JavaScript (AngularJS) code. Thats why, sometimes, it is possible that TS file is imported to JS file. Probably, some of warnings can be caused by this fact. Am I right? @alan-agius4 Following your comment above, I changed it to this one:
Now I am getting the error below:
It is just one of the errors. I have tons of such errors. The main question: Сan you explain in more detail why I was getting warning (before the config change) and why I am getting the error (after I changed the config) now? Please. |
I think that this should be higher than |
After activating ivy in my project (Angular 8.2.12) I had those two warnings by calling ng build --aot --prod:
I fixed by removing the parameter |
@shral those should be ignored automatically, but it looks like they weren't (which is a bug). |
Fix #15626 (comment) (cherry picked from commit 9b91163)
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🐞 Bug report
Command (mark with an
x
)Is this a regression?
Yes
Description
Ivy incorrectly identifies interfaces as unused that compose parts of an object returned from an API endpoint. i.e. Type A that contains Type B, if Type B is never assigned to and is in it's own TS file, Ivy generates warnings that Type B is not an entry point.
Workarounds:
🔬 Minimal Reproduction
https://github.com/fivedice/ivy-warnings
See the ReadMe.md for specific example in the repo.
🔥 Exception or Error
🌍 Your Environment
The text was updated successfully, but these errors were encountered: