nbfontana / ngx-currency

Currency mask module for Angular 📦
https://nbfontana.github.io/ngx-currency
MIT License
237 stars 122 forks source link

erro on build prod angular 8 #67

Open vicenthy opened 4 years ago

vicenthy commented 4 years ago

When run angular build prod command i get de following error

`

ERROR in ./node_modules/ngx-currency/fesm5/ngx-currency.js Module build failed (from ./node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js): TypeError: Cannot read property 'kind' of undefined ` my dependencies

` "dependencies": { "@agm/core": "^1.1.0", "@angular/animations": "^8.2.14", "@angular/cdk": "^8.2.3", "@angular/common": "^8.2.14", "@angular/compiler": "^8.2.14", "@angular/core": "^8.2.14", "@angular/forms": "^8.2.14", "@angular/platform-browser": "^8.2.14", "@angular/platform-browser-dynamic": "^8.2.14", "@angular/router": "^8.2.14", "@asymmetrik/ngx-leaflet": "3.0.1", "@nebular/auth": "4.3.1", "@nebular/eva-icons": "4.3.1", "@nebular/security": "4.3.1", "@nebular/theme": "4.3.1", "@swimlane/ngx-charts": "^10.1.0", "angular-tree-component": "7.2.0", "angular2-chartjs": "0.4.1", "angular2-toaster": "^7.0.0", "bootstrap": "4.3.1", "chart.js": "2.7.1", "ckeditor": "4.7.3", "classlist.js": "1.1.20150312", "core-js": "2.5.1", "echarts": "^4.6.0", "eva-icons": "^1.1.2", "intl": "1.2.5", "ionicons": "2.0.1", "leaflet": "1.2.0", "nebular-icons": "1.1.0", "ng2-ckeditor": "^1.2.6", "ng2-completer": "2.0.8", "ng2-smart-table": "1.3.5", "ngx-currency": "^2.2.1", "ngx-echarts": "^4.2.2", "node-sass": "^4.13.0", "normalize.css": "6.0.0", "pace-js": "1.0.2", "roboto-fontface": "0.8.0", "rxjs": "6.5.4", "rxjs-compat": "6.3.0", "socicon": "3.0.5", "tinymce": "4.5.7", "tslib": "^1.10.0", "typeface-exo": "0.0.22", "web-animations-js": "github:angular/web-animations-js#release_pr208", "zone.js": "~0.9.1" },

`

lucas-thedev commented 4 years ago

getting the same error here

SlapBassist commented 4 years ago

I'm also getting this error and it's a pretty big build blocker for me.

edupooter commented 4 years ago

Me too...

nbfontana commented 4 years ago

Hello, I have tried to simulate the error but the build worked correctly.

Node version: v10.15.3
"dependencies": {
    "@angular/animations": "~8.2.14",
    "@angular/common": "~8.2.14",
    "@angular/compiler": "~8.2.14",
    "@angular/core": "~8.2.14",
    "@angular/forms": "~8.2.14",
    "@angular/platform-browser": "~8.2.14",
    "@angular/platform-browser-dynamic": "~8.2.14",
    "@angular/router": "~8.2.14",
    "core-js": "^2.5.4",
    "ngx-currency": "^2.2.1",
    "rxjs": "~6.5.4",
    "tslib": "^1.9.0",
    "zone.js": "~0.9.1"
  }

Result:

ng build or ng build --prod

Browserslist: caniuse-lite is outdated. Please run next command `npm update`
Generating ES5 bundles for differential loading...
ES5 bundle generation complete.

chunk {main} main-es2015.js, main-es2015.js.map (main) 23.3 kB [initial] [rendered]
chunk {main} main-es5.js, main-es5.js.map (main) 27 kB [initial] [rendered]
chunk {polyfills-es5} polyfills-es5.js, polyfills-es5.js.map (polyfills-es5) 787 kB [initial] [rendered]
chunk {runtime} runtime-es2015.js, runtime-es2015.js.map (runtime) 6.12 kB [entry] [rendered]
chunk {runtime} runtime-es5.js, runtime-es5.js.map (runtime) 6.16 kB [entry] [rendered]
chunk {styles} styles-es2015.js, styles-es2015.js.map (styles) 9.69 kB [initial] [rendered]
chunk {styles} styles-es5.js, styles-es5.js.map (styles) 11 kB [initial] [rendered]
chunk {vendor} vendor-es2015.js, vendor-es2015.js.map (vendor) 4.04 MB [initial] [rendered]
chunk {vendor} vendor-es5.js, vendor-es5.js.map (vendor) 4.89 MB [initial] [rendered]
chunk {polyfills} polyfills-es2015.js, polyfills-es2015.js.map (polyfills) 290 kB [initial] [rendered]
Date: 2020-01-13T15:11:36.766Z - Hash: 6eeea2a637d92903c5a7 - Time: 13467ms

I've created a new clean Angular 8 project for the test... There's anything in particular that could help me simulate that?

If anyone else have a tip about that would be great.

Maybe v1.5.2 or v2.0.1 could temporarily fix the problem.

jlumia commented 4 years ago

@nbfontana

ng build --prod

ERROR in ./node_modules/ngx-currency/fesm5/ngx-currency.js Module build failed (from ./node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js): TypeError: Cannot read property 'kind' of undefined

SlapBassist commented 4 years ago

I believe I found the issue at least with my build, I was explicitly telling node to use a specific version of angular-devkit: ~0.800.0. Increasing it to the latest version (or possibly removing the explicit usage and deleting your node_modules folder), running npm install again and rebuilding seems to have fixed the issue:

Instead of: "@angular-devkit/build-angular": "~0.800.0",

Use: "@angular-devkit/build-angular": "0.803.23",

4typen commented 4 years ago

Using v2.0.1 with "@angular-devkit/build-angular": "0.802.1" brings success. Dont even know whats the problem. It also works with "@angular-devkit/build-angular": "0.803.23" but then causes problems in ui-tests with cypress.

cshouts-tasc commented 4 years ago

Same issue with Angular 7 and @angular-devkit/build-angular v0.13.9. Updating angular-devkit is not an option for us unfortunately.

mcsky commented 4 years ago

Downgrating ngx-currency to 2.0.1 fixed my build, thanks @nbfontana

My stuff versions

Seem to be related to this issue

kapocius commented 4 years ago

Same problem with Angular 7. It isn't an option for me to downgrade, because I need the 2.2.2 version changes.

iankressin commented 4 years ago

Downgrading to ngx-currency 2.0.0 worked for me.

Versions

logic-byte commented 4 years ago

Hi,

There is any way of make it work without downgrade?.

Thanks!!

chinthu commented 3 years ago

Any fixes without downgrade ?