Error on webpack --env.prod
See original GitHub issueBug, feature request, or proposal:
I use VS 2017 Angular SPA. I added Material and all works OK in development mode.
When trying to publish application the webpack process fails:
command: webpack --env.prod
Hash:` 2eb8c943b24c06b91e475086fcf6155c05ab4f19
Version: webpack 2.5.1
Child
Hash: 2eb8c943b24c06b91e47
Time: 23429ms
Asset Size Chunks Chunk Names
main-client.js 247 kB 0 [emitted] main-client
ERROR in ./$$_gendir/~/@angular/material/dialog/typings/index.ngfactory.ts
Module parse failed: C:\...\WebApplication1\$$_gendir\node_modules\@angular\
material\dialog\typings\index.ngfactory.ts Unexpected token (20:37) You may need an appropriate loader to handle this file type. | import * as i9 from ‘@angular/cdk/portal’; | import * as i10 from ‘@angular/material/core’; | export const MatDialogModuleNgFactory:i0.NgModuleFactory<i1.MatDialogModule> = i0.ɵcmf(i1.MatDialogModule, | ([] as any[]),(_l:any) => { | return i0.ɵmod([i0.ɵmpd(512,i0.ComponentFactoryResolver,i0.ɵCodegenComponentFactoryResolver, @ ./$$_gendir/ClientApp/app/app.module.browser.ngfactory.ts 10:0-103 @ ./ClientApp/boot.browser.ts
E RROR in ./$$_gendir/~/@angular/material/datepicker/typings/index.ngfactory.ts
Module parse failed: C:\...\WebApplication1\$$_gendir\node_modules\@angular\
material\datepicker\typings\index.ngfactory.ts Unexpected token (27:41) You may need an appropriate loader to handle this file type. | import * as i16 from ‘…/…/button/typings/index.ngfactory’; | import * as i17 from ‘…/…/icon/typings/index.ngfactory’; | export const MatDatepickerModuleNgFactory:i0.NgModuleFactory<i1.MatDatepickerModule> = i0.ɵcmf(i1.MatDatepickerMod ule, | ([] as any[]),(_l:any) => { | return i0.ɵmod([i0.ɵmpd(512,i0.ComponentFactoryResolver,i0.ɵCodegenComponentFactoryResolver, @ ./$$_gendir/ClientApp/app/app.module.browser.ngfactory.ts 11:0-107 @ ./ClientApp/boot.browser.ts `
What is the expected behavior?
What is the current behavior?
What are the steps to reproduce?
Providing a StackBlitz/Plunker (or similar) is the best way to get the team to see your issue.
Plunker starter (using on @master
): https://goo.gl/DlHd6U
StackBlitz starter (using latest npm
release): https://goo.gl/wwnhMV
What is the use-case or motivation for changing an existing behavior?
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular 4.4.4 Material beta 12, Typescript 2.3, Windows, Visual Studio 2017 Up 3
Is there anything else we should know?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:5 (1 by maintainers)
Top GitHub Comments
@hiepxanh @neojg Removing
include: /ClientApp/
from webpack.config.js file fixed this issue for me. see more here issues/1168This 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.