Topic: ng-admin-pro-5.2.3 ERROR Object is possibly 'null'

LifeQube pro asked 6 years ago


MDB - Angular Admin Dashboard 5.2.3 I purchased the ng-admin-pro-5.2.3 template. Dowloaded, unzipped, ran npm i. When I run ng serve I get this error: ERROR in src/app/typescripts/pro/file-input/classes/mdb-uploader.class.ts(234,90): error TS2531: Object is possibly 'null'. src/app/typescripts/pro/file-input/classes/mdb-uploader.class.ts(239,29): error TS2345: Argument of type 'File | null' is not assignable to parameter of type 'string | Blob'. Type 'null' is not assignable to type 'string | Blob'. src/app/typescripts/pro/file-input/classes/mdb-uploader.class.ts(239,41): error TS2531: Object is possibly 'null'. Please advise    

Damian Gemza staff commented 6 years ago

Dear LifeQube, Please open /src/app/typescripts/pro/file-input/classes/mdb-uploader.class.ts file and find lines 233 (const uploadFile) and 234 (const uploadIndex). Add to this lines types : any. So instead of: const uploadFile = this.fileList.item(file.fileIndex); const uploadIndex = this.uploads.findIndex((upload: any) => upload.file.size === uploadFile.size); There should be const uploadFile: any = this.fileList.item(file.fileIndex); const uploadIndex: any = this.uploads.findIndex((upload: any) => upload.file.size === uploadFile.size); After this, Admin Template should work fine. If not, let me know. It will be fixed in next release. Best Regards, Damian

LifeQube pro answered 6 years ago


Thanks Damian. That worked. Strangely , when I serve in Chrome (on windows) , neither the side menu or top menu are visible. Any ideas what I should be looking at to fix this ?

Damian Gemza staff commented 6 years ago

Sidenav and Navbar should be always visible there, so it's right behavior. Does on other browsers nav isn't visible?

LifeQube pro commented 6 years ago

In Firefox and Explorer the left side menu is visible but not the top menu. In Chrome neither menu is visible. There is a black white bar on the top but none of the menu content shows (in all browsers)

Damian Gemza staff commented 6 years ago

Could you show me some screenshots?

LifeQube pro commented 6 years ago

Sure, how do I post screen shots here?

Damian Gemza staff commented 6 years ago

Post in new message instead of comment or paste me here links

LifeQube pro commented 6 years ago

Cant paste images in the New message box either: https://www.dropbox.com/s/3afrtfb79s9z6gw/Chrome%20Capture1.PNG?dl=0 https://www.dropbox.com/s/agt2j5bxl11y1an/Firefox%20Capture.PNG?dl=0

Damian Gemza staff commented 6 years ago

Dear LifeQube, Problems with navbars which you've showed me on screenshots are already solved. Please download Angular Admin Template from our GitLab repo: https://git.mdbootstrap.com/mdb/angular/ng-admin-pro Best Regards, Damian

LifeQube pro commented 6 years ago

If I use the username and password from my account I cant login to the gitgub repo. What username and password should I be using?

Damian Gemza staff commented 6 years ago

You have to write an email at contact@mdbootstrap.com. My friend will provide you access to GitLab repo.

Damian Gemza staff answered 6 years ago


Open /src/app/views/dashboards/dashboard1/dashboard1.component.html and in line 64 (mdb-simple-chart) add this code: [animate]="{duration: 1000, enabled: true}". After changes this line should look like below:
<mdb-simple-chart [percent]="56" [barColor]="'FF5252'" [animate]="{duration: 1000, enabled: true}"></mdb-simple-chart>
This also will be fixed in next release.

LifeQube pro answered 6 years ago


Thank you Damian, that error has been resloved and I can now serve the app. Now I am getting this error in the console: Dashboard1Component.html:43 ERROR TypeError: Cannot read property 'duration' of undefined at SimpleChartComponent.ngOnInit (chart-simple.component.ts:52) at checkAndUpdateDirectiveInline (core.js:12369) at checkAndUpdateNodeInline (core.js:13893) at checkAndUpdateNode (core.js:13836) at debugCheckAndUpdateNode (core.js:14729) at debugCheckDirectivesFn (core.js:14670) at Object.eval [as updateDirectives] (Dashboard1Component.html:64) at Object.debugUpdateDirectives [as updateDirectives] (core.js:14655) at checkAndUpdateView (core.js:13802) at callViewAction (core.js:14153)

Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags