fetrarij / ngx-daterangepicker-material

Pure Angular 2+ date range picker with material design theme, a demo here:
https://fetrarij.github.io/ngx-daterangepicker-material/
MIT License
250 stars 255 forks source link

ERROR in Could not resolve moment/ts3.1-typings/moment #336

Closed prachigupta2607 closed 3 years ago

prachigupta2607 commented 4 years ago

Versions

*Describe the bug: Getting ERROR in Could not resolve moment/ts3.1-typings/moment from ..../angular/node_modules/ngx-daterangepicker-material/ngx-daterangepicker-material.d.ts when angular code re-compiles for changes.

Please help me out.

muhitoLV commented 4 years ago

Same issue

Versions

On compile throws error: ERROR in Could not resolve moment/ts3.1-typings/moment from .../node_modules/ngx-daterangepicker-material/ngx-daterangepicker-material.d.ts

fetrarij commented 4 years ago

@muhitoLV @prachigupta2607 try to downgrade your moment, use 2.27.0 instead.

prachigupta2607 commented 4 years ago

@muhitoLV @prachigupta2607 try to downgrade your moment, use 2.27.0 instead. It didn't work. Still getting the same issue.

prachigupta2607 commented 4 years ago

@muhitoLV @prachigupta2607 try to downgrade your moment, use 2.27.0 instead. It didn't work. Still getting the same issue.

Downgrading moment to 2.24.0 worked for me.

fetrarij commented 4 years ago

I have tried with this config

and works like a charm.

manali-sankey commented 4 years ago

Getting ERROR in Could not resolve moment/ts3.1-typings/moment from ..../angular/node_modules/ngx-daterangepicker-material/ngx-daterangepicker-material.d.ts when angular code re-compiles for changes.

After that i have only installed moment with below command:

and its worked for me.

dmrugalski commented 3 years ago

My solution was comment out those lines in:

//  "angularCompilerOptions": {
//    "enableIvy": false
//  }

and add this line into compilerOptions:

"allowSyntheticDefaultImports": true,
tmgayathri commented 3 years ago

I am getting the same error after Angular 9 upgrade. I'm using the below components: Angular: 9.1.13 Moment: 2.29.1 ngx-daterange-picker: 2.4.1 tslib: 1.10.0

Also I have the enableIvy: false as its needed for my upgrade

I tried most of the above solutions:

  1. Downgrade moment to 2.27.0, 2.24.0
  2. using component version 4.0.1
  3. Using the exact component version (without the "^")

Any suggestion would be helpful.

Nasruddinkhan commented 3 years ago

Getting ERROR in Could not resolve moment/ts3.1-typings/moment I tried most of the above solutions now it's working when id add "allowSyntheticDefaultImports": true property in tsconfig.app.json file and remove "angularCompilerOptions": { "enableIvy": false}.

fetrarij commented 3 years ago

Hello, moment is replaced by dayjs in this component. Use the latest version.

Thanks