fingerpich / jalali-angular-datepicker

Highly configurable jalali (shamsi, khorshidi, persian) date picker built for Angular ( 2 or more ) applications
https://fingerpich.github.io/jalali-angular-datepicker/
MIT License
152 stars 61 forks source link

ERROR TypeError: Cannot read property 'gregorian' of undefined #100

Closed hasanfathi closed 5 years ago

hasanfathi commented 5 years ago

I use jalali date picker and add only this item in package.json file "ng2-jalali-date-picker": "^2.0.3" package.json file structure:

{
  "name": "client-app",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "_0-prerestore": "npm install",
    "_0-restore": "dotnet restore",
    "_1-ng-build-dev": "ng build --watch",
    "_1-ng-build-prod": "ng build --prod --watch",
    "_2-dotnet-run": "dotnet watch run",
    "_2-ng-serve-proxy": "ng serve --proxy-config proxy.config.json "
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^6.0.0",
    "@angular/cdk": "^6.0.0",
    "@angular/common": "^6.0.0",
    "@angular/compiler": "^6.0.0",
    "@angular/core": "^6.0.0",
    "@angular/flex-layout": "^5.0.0-beta.14",
    "@angular/forms": "^6.0.0",
    "@angular/http": "^6.0.0",
    "@angular/material": "^6.0.0",
    "@angular/platform-browser": "^6.0.0",
    "@angular/platform-browser-dynamic": "^6.0.0",
    "@angular/router": "^6.0.0",
    "@swimlane/ngx-datatable": "^11.3.2",
    "angular-hammer": "^2.2.0",
    "core-js": "^2.5.5",
    "flex-layout": "^1.0.1",
    "hammerjs": "^2.0.8",
    "i": "^0.3.6",
    "jquery": "~3.3.1",
    "jwt-decode": "^2.2.0",
    "mdi": "^2.2.43",
    "ng2-jalali-date-picker": "^2.0.3",
    "ngvas": "^0.7.6",
    "ngx-bootstrap": "^2.0.4",
    "ngx-permissions": "^5.0.0",
    "ngx-spinner": "^6.0.0",
    "npm": "^6.0.0",
    "popper.js": "^1.14.3",
    "rxjs": "^6.1.0",
    "rxjs-compat": "^6.1.0",
    "zone.js": "^0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.6.0",
    "@angular/cli": "~6.0.0",
    "@angular/compiler-cli": "^6.0.0",
    "@angular/language-service": "^6.0.0",
    "@types/jasmine": "^2.8.6",
    "@types/jasminewd2": "^2.0.3",
    "@types/node": "^10.0.0",
    "codelyzer": "^4.3.0",
    "jasmine-core": "^3.1.0",
    "jasmine-spec-reporter": "^4.2.1",
    "karma": "~2.0.2",
    "karma-chrome-launcher": "~2.2.0",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.4.2",
    "karma-jasmine": "~1.1.1",
    "karma-jasmine-html-reporter": "^1.0.0",
    "protractor": "^5.3.1",
    "ts-node": "^6.0.1",
    "tslint": "^5.9.1",
    "typescript": "~2.7.2"
  }
}

this package work my local machine, after build my angular app with this command: ng build --prod and deploy in server, get this errors in components that contain date picker and my page not render. errors: ERROR TypeError: Cannot read property 'gregorian' of undefined ERROR TypeError: Cannot read property 'hideInputContainer' of undefined ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'format' of undefined

fingerpich commented 5 years ago

Please make a demo on stackblitz, plunker, ...

hasanfathi commented 5 years ago

i not a problem of using this package its work in my local machine after deploy i get error and my page not render i not any idea for this problem can you help me?

fingerpich commented 5 years ago

You should ask this kind of question in Stackoverflow, there are more people to help you. good luck

hasanfathi commented 5 years ago

This problem related to my used command for build application. instead of ng build --prod command i use this command ng build --prod --aot=false --build-optimizer=false --no-progress and my problem solved.