Topic: autocomplete - error: Cannot read property 'title' of nul

duong do free asked 6 years ago


Dear supporter, We are using  autocomplete in our Angular 5 project. Unfortunately, we got the following error. "null: ERROR null: TypeError: Cannot read property 'title' of null message: "Cannot read property 'title' of null" ngDebugContext: DebugContext_ {view: Object, nodeIndex: 5, nodeDef: Object, …} ngErrorLogger: function () { … } stack: "TypeError: Cannot read property 'title' of null at eval (webpack-internal:///./node_modules/ng-mdb-pro/pro/autocomplete/directives/input.directive.ts:53:40) at SafeSubscriber.schedulerFn [as _next] (webpack-internal:///./node_modules/@angular/core/esm5/core.js:4559:36) at SafeSubscriber.__tryOrUnsub (webpack-internal:///./node_modules/rxjs/_esm5/Subscriber.js:245:16) at SafeSubscriber.next (webpack-internal:///./node_modules/rxjs/_esm5/Subscriber.js:192:22) at Subscriber._next (webpack-internal:///./node_modules/rxjs/_esm5/Subscriber.js:133:26) at Subscriber.next (webpack-internal:///./node_modules/rxjs/_esm5/Subscriber.js:97:18) at EventEmitter.Subject.next (webpack-internal:///./node_modules/rxjs/_esm5/Subject.js:66:25) at EventEmitter.emit (webpack-internal:///./node_modules/@angular/core/esm5/core.js:4527:46) at MdbCompleterDirective.search (webpack-internal:///./node_modules/ng-mdb-pro/pro/autocomplete/directives/completer.directive.ts:47:27) at eval (webpack-internal:///./node_modules/ng-mdb-pro/pro/autocomplete/directives/input.directive.ts:73:37)" __proto__: Error {constructor: , name: "TypeError", message: "", …} null: ERROR CONTEXT null: DebugContext_ {view: Object, nodeIndex: 5, nodeDef: Object, elDef: Object, elView: Object}" We have searched in the support forum but no solutions added. (https://mdbootstrap.com/support/bug-mdb-completer-component-minimized-cannot-read-property-title-of-null/) We also tried to use the latest version. But we got the same error. We can send you the sample code and reproducing steps, if request. We are waiting for your reply. Thanks in advance. Regards, Duong Do

Damian Gemza staff commented 6 years ago

Dear Duong_do, of course, please send me a reproduction steps and sample code. It would help me, to debug your problem. Waiting to hear from you. Best Regards, Damian

duong do free commented 6 years ago

I tried to send you email but it returned error. I sent to "d.gemza@mdbootstrap.com" but somehow it sent to "gemza.damian@gmail.com". We did have contact around month ago via this email "d.gemza@mdbootstrap.com". However, you can download the sample code at "https://github.com/duong-do/NgMDB_Autocomplete" reproduce steps: 1) Start project 2) Select another country for instance Belgum 3) Delete m -> u ->g -> l. After delete the leter ‘l’, we get this error. ======================== Bronserver: mo10.mail-out.ovh.net gemza.damian@gmail.com gmail-smtp-in.l.google.com Remote Server returned '' Oorspronkelijke berichtkoppen: Return-Path: Received: from mail346.ha.ovh.net (unknown [10.109.101.131]) by mo10.mail-out.ovh.net (Postfix) with SMTP id 21E1F14D393 for ; Thu, 15 Mar 2018 21:38:07 +0100 (CET) Received: from localhost (HELO queueout) (127.0.0.1) by localhost with SMTP; 15 Mar 2018 22:38:06 +0200 Delivered-To: mdbootstrap.com-d.gemza@mdbootstrap.com Received: from localhost (HELO queue) (127.0.0.1) by localhost with SMTP; 15 Mar 2018 22:38:06 +0200 Received: from output36.mail.ovh.net (164.132.34.36) by mail.ovh.net with AES256-GCM-SHA384 encrypted SMTP; 15 Mar 2018 22:38:06 +0200 Received: from vr6.mail.ovh.net (unknown [10.101.8.6]) by out36.mail.ovh.net (Postfix) with ESMTP id 910DC7C6A for ; Thu, 15 Mar 2018 21:38:06 +0100 (CET) Received: from in66.mail.ovh.net (unknown [10.101.4.66]) by vr6.mail.ovh.net (Postfix) with ESMTP id 5E5CF37A0066 for ; Thu, 15 Mar 2018 21:38:06 +0100 (CET) Received-SPF: None (no SPF record) identity=mailfrom; client-ip=80.250.128.7; helo=mailgw1.aareon.com; envelope-from=duong.do@aareon.nl; receiver=d.gemza@mdbootstrap.com Received: from mailgw1.aareon.com (mailgw1.aareon.com [80.250.128.7]) by in66.mail.ovh.net (Postfix) with ESMTPS id 2B5D2AB for ; Thu, 15 Mar 2018 21:38:06 +0100 (CET) From: Duong Do To: Damian Gemza Subject: autocomplete - error: Cannot read property 'title' of nul - Category Angular

duong do free answered 6 years ago


Thanks Damian,

Adding "return" is solved this problem. Can you closed this topic?

Regards,

Duong


Damian Gemza staff answered 6 years ago


Guys, could you try solution posted by jesustome user? He was facing same problem like you. https://mdbootstrap.com/support/bug-mdb-completer-component-minimized-cannot-read-property-title-of-null/ Best Regards, Damian

osoverflow pro answered 6 years ago


I have the same problem

duong do free commented 6 years ago

This problem is solved in the latest version.

Damian Gemza staff answered 6 years ago


Unfortunately, I'm unnable to reproduce your problem, but head into input.directive.ts file, and below line 53 paste code below:
try {

if (item===null) {

throw {};

}

} catch (err) {

}

Maybe this will help you.
Best Regards,
Damian

duong do free commented 6 years ago

Dear Damian, You cannot reproduce this error? it's strange. We tried to add this code to our project but we still got the same error. Moreover, when we deployed our project to azure, this piece of code will be deleted after build. It's not a right solution. Which version do you use in the token by "ng-mdb-pro"? we use: git.mdbootstrap.com/mdb/angular/ng-pro.git#5.2.0 Browser: Google Chrome Versie 65.0.3325.162 (Officiële build) (64-bits) Can you send us your "node_modulesng-mdb-pro" map in .zip file? if you cannot reproduce this error that means we don't have the same library like you. We can provide you our authentication token if needed. Regards, Duong

Damian Gemza staff commented 6 years ago

Dear Duong, I'm using our latest dev version of MDB (5.2.3 version). Today we should release new version of MDB Angular. You can download our latest dev builds from our GitLab dev branch. Best Regards, Damian


Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Resolved

Specification of the issue

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