No : ....
After successfully npm install these 20+ warnings are coming. Made changes in tsconfig file but still no luck. Please help me on this.
WARNING in ......srcappAdminPanelAdminAccountAccountSettingAccountSetting.component.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.
WARNING in ......\src\app\AdminPanel\AdminAccount\AccountSetting\AccountSetting.component.ts is part of the TypeScript compilation but it's unused.
tsconfig.app.json file:
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"types": [
"node"
]
},
"files": [
"main.ts",
"polyfills.ts"
],
"include": [
"src/**/*.d.ts"
]
}
Please help me out!
This seems like a bug but we'll need to look at a reproduction to find and fix the problem. Can you setup a minimal repro please?
You can read here why this is needed. A good way to make a minimal repro is to create a new app via ng new repro-app and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.
This might be related to your directory structure so its really important to get an accurate repro to diagnose this.
HI, @sharikovvladislav
Do you have any workaround for this issue, as i was searching for solution you had same warnings as i got it now. Help Me if you have any solution. Thanks!
@alan-agius4 I'm also experiencing this issue upgrading from 8.2.3 to 9, but I don't think it's an angular problem; Was there supposed to be some update to my app's tsconfig file with the upgrade? (It doesn't appear to have changed)
EDIT: It's worth noting that i'm working with a project that has multiple modules within the /src folder i.e. src/modules/app, src/modules/dev, etc.
EDIT:EDIT: Got everything to work without warnings by adding a separate tsconfig file under each module with the main.ts and polyfills specified under "files"
e.g.
{
"extends": "../../tsconfig.json",
"files": [
"./app.main.ts",
"../../polyfills.ts"
]
}
Only catch is that now when trying to build in the production environment I get a bunch of template errors from the other modules i.e running ng build --prod --project app gives errors for components under the dev module
EDIT:EDIT:EDIT: It seems that disabling ivy and/or disabling aot compilation causes everything to work without warnings/errors, not really fixing the problem but hopefully narrowing it down
I had the same WARNING messages after upgrading from 8.2.14 to 9. But I think those warning messages are correct(helping) for me, because I was not actually using those .ts files in my project.
@naingaungphyo I'm running into the same problem with a 8 to 9 upgrade and oddly our files are being used
I had the same WARNING messages after upgrading from 8.2.14 to 9. But I think those warning messages are correct(helping) for me, because I was not actually using those .ts files in my project.
Although, I said that those messages are correct(helping) for me, I found that environment.prod.ts is also in WARNING list, but it shouldn't be.
fyi,
I fixed my WARNING messages by changing tsconfig.app.json include section like this.
ref
"include": [
"src/*/.d.ts"
],
It was like this before. btw I have no idea why that was "*.ts".
"include": [
"src/*/.ts"
],
according to OP tsconfig.app.json in report, you shouldn't have those WARNING messages like mine.
I got error by using this (include) and your project is running with it? if yes then, could you please share tsconfig.app.json file
@karamjeetiron
This is my tsconfig.app.json. The only diff with yours is "types": ["node"] and I have "exclude" and "files" path.
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": []
},
"files": [
"src/main.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.d.ts"
],
"exclude": [
"src/test.ts",
"src/**/*.spec.ts"
]
}
I got error by using this (include) and your project is running with it?
Edit: I wanna make clear that I'm not saying you are having the error because of your include setting. I'm just saying that you have the correct include setting that I didn't have.
Thanks for reporting this issue. However, you didn't provide sufficient information for us to understand and reproduce the problem. Please check out our submission guidelines to understand why we can't act on issues that are lacking important information.
If the problem persists, please file a new issue and ensure you provide all of the required information when filling out the issue template.
@naingaungphyo - This suggestion helped get rid of these warnings for me. Specifically changing:
"include": [
"src/main.ts",
"src/polyfills.ts"
]
to:
"files": [
"src/main.ts",
"src/polyfills.ts"
]
@naingaungphyo Thanks for reporting your solution to solve these warnings!
I fixed my WARNINGS (using your solution), so by changing my tsconfig.app.json in this way:
tsconfig.app.jsonbefore (with warnings)
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"module": "es2015",
"types": []
},
"exclude": [
"src/test.ts",
"**/*.spec.ts"
]
}
I just added the entry points, for the unused files, to the "include" property:
tsconfig.app.jsonafter (without any warnings)
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"module": "es2015",
"types": []
},
"include": [
"src/test.ts",
"src/**/*.prod.ts"
],
"exclude": [
"**/*.spec.ts"
]
}
So Thank you! Your solution was so helpful! 馃槈馃憤馃徏
So I am having this same issue. I have tried both changing src/**/*.ts to src/**/*.d.ts and removing includes from my tsconfig.app.json. Both of these solutions seem to work by eliminating the warning but which is the correct solution? I feel that after running Angular-CLI I shouldn't have to make these changes as Angular-CLI is the one who created them. Am I wrong here?
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._
Most helpful comment
@naingaungphyo I'm running into the same problem with a 8 to 9 upgrade and oddly our files are being used