0

when iam adding ngx date rangepicker module to my angular project,cannot build it. it failed with error:

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

anybody know what is the problem??

3 Answers 3

2

Finally I have the answer... this issue is with the new version of ngx-daterangepicker release. When I used a lower version, I could build with no issues. Thank you for your support.

Version -

"ngx-daterangepicker-material": "~2.0.2" 
Sign up to request clarification or add additional context in comments.

3 Comments

can you please mention the version which you were used, facing the same issue.
try with "ngx-daterangepicker-material": "~2.0.2",
got fixed this issue with the 2.1.11 version.
0

https://stackblitz.com/edit/angular-ngx-daterangepicker-material-build-problem

This is working while using ng serve but I build the entire angular app using ng build --prod and the issue was the following

"fileReplacements": [ { "replace": "src/environments/environment.ts", "with": "src/environments/environment.prod.ts" } ], 

and as the stackblitz exports doesn't contian environments directory you should resolve the issue either by adding such files or comment this lines on angular.json

second problem was for old version of angular dependencies which stackblitz offers, so I updated them on packages.json to what ng new myApp generates.

"@angular/animations": "~9.0.1", "@angular/common": "~9.0.1", "@angular/compiler": "~9.0.1", "@angular/core": "~9.0.1", "@angular/forms": "~9.0.1", "@angular/platform-browser": "~9.0.1", "@angular/platform-browser-dynamic": "~9.0.1", "@angular/router": "~9.0.1", "@angular-devkit/build-angular": "~0.900.2", "@angular/cli": "~9.0.2", "@angular/compiler-cli": "~9.0.1", "@angular/language-service": "~9.0.1", "typescript": "~3.7.5" 

finally it successfully build using ng build --prod

3 Comments

sorry bro i cannot update to this version(9.0) other componenents will have issues
try changing/updating @angular-devkit/build-angular package. it seems there might be something went wrong.
Package "ngx-datepicker-material" has an incompatible peer dependency to "@angular/common" (requires "^6.0.0-rc.0 || ^6.0.0" (extended), would install "9.0.2"). how to fix it ??.can u help?
0

Fixed a very similar kind of problem I fixed by upgrading to

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.