Base solution for your next web application
Open Closed

production build errors with demo-ui #3732


User avatar
0
dparizek created

If I npm start in development, my app works great. If I ng build -prod then I get the following errors... suggestions?

PS C:\Code\Research1\angular\nswag> ng build -prod
 26% building modules 135/135 modules 0 activeTemplate parse warnings:
The <template> element is deprecated. Use <ng-template> instead ("
[WARNING ->]<template [ngIf]="!isClosed">
  <div [class]="'alert alert-' + type" role="alert" [ngClass]="classes""): ng:///C:/Code/Research1/angular/node_modules/
ngx-bootstrap/alert/alert.component.d.ts.AlertComponent.html@1:0           29% building modules 161/163 modules 2 active
 ...de\Research1\angular\src\polyfills.tsThe final argument to magicString.overwrite(...) should be an options object. S
ee https://github.com/rich-harrisHash: 2039610d45e09eed3b23
Time: 106219ms
chunk    {0} 0.fd9ea3ad528147ac00b5.chunk.js (common) 58.3 kB {1} {2} {3} {4} {5} {6} {7} [rendered]
chunk    {1} 1.35dbaabb3626bd7f599d.chunk.js 1.05 MB {2} {3} {6} [rendered]
chunk    {2} 2.0b6658237ace649389ef.chunk.js 2.24 MB {1} {3} {6} [rendered]
chunk    {3} 3.35f1e54efdcd2da9e9f1.chunk.js 528 kB {1} {2} {6} [rendered]
chunk    {4} polyfills.4657b8654ff149057557.bundle.js (polyfills) 276 kB {9} [initial] [rendered]
chunk    {5} scripts.216b44209a346e669e21.bundle.js (scripts) 3.36 MB {9} [initial] [rendered]
chunk    {6} main.24688bf8e6a4de469eb9.bundle.js (main) 1.32 MB {8} [initial] [rendered]
chunk    {7} styles.28046069b1f9a44a8998.bundle.css (styles) 1.24 kB {9} [initial] [rendered]
chunk    {8} vendor.948d8c386c1050722ad7.bundle.js (vendor) 4.91 MB [initial] [rendered]
chunk    {9} inline.bf4215265e0dd9ebb701.bundle.js (inline) 0 bytes [entry] [rendered]

ERROR in ng:///C:/Code/Research1/angular/src/app/admin/demo-ui-components/demo-ui-selection.component.html (29,60): Expe
cted 1 arguments, but got 0.

ERROR in ng:///C:/Code/Research1/angular/src/app/admin/demo-ui-components/demo-ui-selection.component.html (52,60): Expe
cted 1 arguments, but got 0.

ERROR in ng:///C:/Code/Research1/angular/src/app/admin/demo-ui-components/demo-ui-selection.component.html (29,60): Expe
cted 1 arguments, but got 0.

ERROR in ng:///C:/Code/Research1/angular/src/app/admin/demo-ui-components/demo-ui-selection.component.html (52,60): Expe
cted 1 arguments, but got 0.

1 Answer(s)
  • User Avatar
    0
    alirizaadiyahsi created

    Reason: There are methods with parameters. But we didn't pass any parameter to these methods. So it is giving error at production time.

    Solution: We fixed it by removing parameters from these methods. Check this commit: <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/commit/bc397a00bb41be272ae2ae84243062f223c572a5">https://github.com/aspnetzero/aspnet-ze ... f223c572a5</a>