Closed Gnorro closed 4 years ago
Without Ivy we get different erros. I will open a new 3ad for that.
Some other info about our project, because I think that this problem on lazy route could be related to this (but I'm not sure about that): In our core.module we have this:
import { lazyloadFilemappings } from 'app/config/lazyload-filemappings';
@NgModule({
imports: [
...
LoadableModule.forRoot({
fileMappings: lazyloadFilemappings
})
],
This file is:
export const lazyloadFilemappings = {
'footer': 'src/app/features/layout-root/footer/footer.module#FooterModule',
'layout-root-under-fold':
'src/app/features/layout-root/layout-root-under-fold/layout-root-under-fold.module#LayoutRootUnderFoldModule',
'homepage-under-fold':
'src/app/features/homepage/homepage-under-fold/homepage-under-fold.module#HomepageUnderFoldModule',
'appliances-menu-section':
'src/app/header/menu/item-menu/menu-sections/appliances-menu-section/appliances-menu-section.module#AppliancesMenuSectionModule',
'casa-menu-section':
'src/app/header/menu/item-menu/menu-sections/casa-menu-section/casa-menu-section.module#CasaMenuSectionModule',
'brico-menu-section':
'src/app/header/menu/item-menu/menu-sections/brico-menu-section/brico-menu-section.module#BricoMenuSectionModule',
'engines-menu-section':
'src/app/header/menu/item-menu/menu-sections/engines-menu-section/engines-menu-section.module#EnginesMenuSectionModule',
'info-menu-section':
'src/app/header/menu/item-menu/menu-sections/info-menu-section/info-menu-section.module#InfoMenuSectionModule',
'other-menu-section':
'src/app/header/menu/item-menu/menu-sections/other-menu-section/other-menu-section.module#OtherMenuSectionModule',
'phone-menu-section':
'src/app/header/menu/item-menu/menu-sections/phone-menu-section/phone-menu-section.module#PhoneMenuSectionModule',
'toys-menu-section':
'src/app/header/menu/item-menu/menu-sections/toys-menu-section/toys-menu-section.module#ToysMenuSectionModule',
'tv-audio-video-menu-section':
'src/app/header/menu/item-menu/menu-sections/tv-audio-video-menu-section/tv-audio-video-menu-section.module#TvAudioVideoMenuSectionModule',
'video-games-menu-section':
'src/app/header/menu/item-menu/menu-sections/video-games-menu-section/video-games-menu-section.module#VideoGamesMenuSectionModule',
'club-menu-section':
'src/app/header/menu/item-menu/menu-sections/club-menu-section/club-menu-section.module#ClubMenuSectionModule'
};
In our main menu component we have:
<div class="item-menu" (mouseover)="openMenu()" (mouseleave)="this.menuState = false">
<a (click)="goToPath('xxx')">{{ this.mainitem }}</a>
<div class="submenu-container" [ngClass]="{ open: this.menuState == true }">
<ngx-loadable [show]="true" [module]="'tv-audio-video-menu-section'"></ngx-loadable>
</div>
</div>
We load that using ngx-loadable
Beginning from angular 8 syntax for lazy load changed from: { path: 'cashback', loadChildren: './features/cashback/cashback.module#CashbackModule' } to { path: 'cashback', loadChildren: () => import('./features/cashback/cashback.module').then(m => m.CashbackModule) }
I don't know if I need to change something also in lazyloadFilemappings values, for example remove everything after "#", so something like this: from: 'tv-audio-video-menu-section': 'src/app/header/menu/item-menu/menu-sections/tv-audio-video-menu-section/tv-audio-video-menu-section.module#TvAudioVideoMenuSectionModule' to 'tv-audio-video-menu-section': 'src/app/header/menu/item-menu/menu-sections/tv-audio-video-menu-section/tv-audio-video-menu-section.module'
Errors I get are related to those modules defined in lazyloadFilemappings. This is the reason why I wanted to give more info about that.
Thanks
Did you use ng update
for the update? It should update your tsconfig.json
to avoid this.
Have you taken a look at update.angular.io?
I followed instruction on update.angular.io
Yes, I ran ng update
Regarding the Renderer
/Renderer2
error:
Renderer
has been deprecated since v4 and is removed in v9 (see https://v9.angular.io/guide/deprecations#removed-apis).
You can open an issue on the 3rd-party library to upgrade to Renderer2
(you can point them here for details: https://next.angular.io/guide/migration-renderer).
Apart from that, I am not sure what the problem is. Could you create a minimal reproduction?
(FWIW, I don't think this is related to ngcc
.)
I have the same issue but I'm on a project with some AngularJS files written in TypeScript. I updated my tsconfig.app.json to add
"files": ["src/app/main.ts", "html.d.ts", "src/app/constants.ts"],
"include": ["src/**/*.d.ts"],
But I have this kind of error when I launch my app.
For information: cookie.service.ts is an angularJS service
I have other errors, all of them are about AngularJS TypeScript files.
ERROR in ./src/app/utils/cookie/cookie.service.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: /Users/wmarques/workspace/artel/telematics-services/telematics-bo-web/src/app/utils/cookie/cookie.service.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
at AngularCompilerPlugin.getCompiledFile (/Users/wmarques/workspace/artel/telematics-services/telematics-bo-web/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:909:23)
at /Users/wmarques/workspace/artel/telematics-services/telematics-bo-web/node_modules/@ngtools/webpack/src/loader.js:41:31
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
@ ./src/app/utils/utils.module.js 3:0-56 12:96-109
@ ./src/app/app.module.ts
@ ./src/app/app.ng2.module.ts
@ ./src/app/main.ts
The fix is probably to add those files to the files
array but I don't think that's a very clean solution...
My Error: After going from ng8 to ng9 ... Please make sure it is in your tsconfig via the 'files' or 'include' property. ...
(everything red, I was shocked)
My situtation: I have a folder with many lazy loaded modules which I dynamically load with heroLoader
. They are all declared in my angular.json. They are located in app/src/app/lazyModules/...
So I went into tsconfig.app.json
and tsconfig.spec.json
and added
"include": [
...
"**/app/lazyModules/**/*.ts"
]
by using **/
in the front I prevent that path bullshit guessing because I NEVER know what they want from me here /scr
, scr
, ./
.. etc.
[from angular update page]
We have updated the tsconfig.app.json to limit the files compiled. If you rely on other files being included in the compilation, such as a typings.d.ts file, you need to manually add it to the compilation.
I believe this is exactly what they mean. We have to include those modules, manually.
Hope this helps someone.
This sounds more like a support request for StackOverflow than a bug report.
You are using ngx-gallery
as a dependency and it imports Renderer
, but there has been no such export in @angular/core
for a long time. You should check if ngx-gallery
has an update. Also, for a successful update, you should always follow the official docs - with emphasis on https://update.angular.io/
A quick tip: whenever I update a project, I always compare the project files with the files from a newly generated Angular project and I port all the changes so that the project looks as much as possible as a brand new project.
Hi all,
There seems to have been multiple issues reported here.
1) ngx-gallery
If you are using ngx-gallery
, please see the comment from @SchnWalter here: https://github.com/angular/angular-cli/issues/17804#issuecomment-634867805
2) lazy loading without using dynamic imports
If you are using lazy loading, either via the deprecated string based syntax, or some other custom way, which is not statically analysable by the build system. You will need to need to include the lazy loaded modules manually inside the compilation, by specifying either include
or files
options in the TypeScript configuration file.
Example
{
"extends": "./tsconfig.base.json",
"compilerOptions": {...},
"files": [...],
"include": [
"src/**/*.d.ts",
"src/**/*.lazy.ts",
]
}
More info about lazy loading: https://angular.io/guide/lazy-loading-ngmodules
A quick tip: whenever I update a project, I always compare the project files with the files from a newly generated Angular project and I port all the changes so that the project looks as much as possible as a brand new project.
When using ng update
we actually executer migrations to update existing projects to have the same structure as new projects.
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.
π bug report
Description
We have lot of errors when enabling Ivy and making a ng serve
π₯ Exception or Error
Same error on lots of modules
Error screenshot:
Second error is about ngx-gallery lib I suppose:
Error screenshot:
This lib is already updated to last version
π Your Environment
Angular Version:
Anything else relevant?
Our package.json:
Our tsconfig.json:
Our tsconfig.app.json:
Thanks for your help