We have moved to a new Sailfish OS Forum. Please start new discussions there.
5

How to get rid of: TypeError: 'parent' of null @ Util.js:38 ?

asked 2016-06-17 10:14:06 +0300

mobilitio gravatar image

updated 2018-12-03 19:06:45 +0300

Tanghus gravatar image

In my QML/JS app, why I get every time the initial page is opened, a warning is written to the console? (the warning seems harmless anyhow, but...)

 [W] unknown:38 - file:///usr/lib/qt5/qml/Sailfish/Silica/private/Util.js:38: TypeError: Cannot read property 'parent' of null

Looking at the code, the Util page gets a null parent, clear. Why is that?

function findFlickable(item) {
    var parentItem = item.parent

I had the same problem with some other pages, and it seemed to help that I declare all the offending pages in the <application-name.qml> which is invoked right from C++, inside a Component.</application-name.qml>

ApplicationWindow
{
    id: appWindow

---8<--
    Component {
        id: anotherPage
        AnotherPage {}
    }

    Component {
        id: firstPage
        FirstPage {}
    }

    initialPage: firstPage
---8<---
}

The pages are written in their own QML files, of course. As Pages:

Page {
    id: firstPage

What's the problem, or is this just a charcteristic which just has to be ignored? In my opinion, the errors and warnings should be fixed in applications, or at least there should be a reason to leave them put.

edit retag flag offensive close delete

Comments

show code where you using flickables

coderus ( 2016-06-17 17:56:26 +0300 )edit

It's all there: https://github.com/alketola/harbour-ostos/tree/master/qml/

Almost all pages have a sort of Silica flickable, these have SilicaFlickable: https://github.com/alketola/harbour-ostos/blob/master/qml/harbour-ostos.qmlhttps://github.com/alketola/harbour-ostos/blob/master/qml/pages/ItemEditPage.qmlhttps://github.com/alketola/harbour-ostos/blob/master/qml/pages/SettingsPage.qml

In particular, there is a SilicaListView inside a SilicaFlickable in ItemAddPage...is it bad? https://github.com/alketola/harbour-ostos/blob/master/qml/pages/ItemAddPage.qml lines 63, 101

Thanks for your interest.

mobilitio ( 2016-06-17 20:21:23 +0300 )edit

try assigning flickable: theFlickable for DialogHeader

coderus ( 2016-06-17 20:33:31 +0300 )edit

I removed the how-to tag, as that is for posts explaining how to solve an issue. And added some useful tags instead.

Tanghus ( 2018-12-03 19:08:24 +0300 )edit

3 Answers

Sort by » oldest newest most voted
0

answered 2019-09-21 10:13:14 +0300

mahdi gravatar image

updated 2019-09-21 10:15:16 +0300

i did this :

default property list<QtObject> _data     
Component.onCompleted: {
    for(var i in _data){
        if (_data[i].parent == null){
            _data[i].parent = invis
        }
    }
}
Item{
    id:invis
    visible: false
}
edit flag offensive delete publish link more
1

answered 2018-11-29 20:38:58 +0300

Direc gravatar image

updated 2018-12-02 21:52:55 +0300

Hi,

Please have a look at my question:

https://together.jolla.com/question/194846/howto-sdk-fix-typeerror-messages-in-dialogheaderqml-and-utilsjs/

I think I developed a fix for the issue.

Edit: Jolla responded to my question, and sadly it looks like Jolla won't silence the error messages since they are actually Qt bugs. That may be fixed in a future Qt version update, but until then, the messages can be safely ignored (or silenced).

edit flag offensive delete publish link more
1

answered 2016-06-17 11:26:08 +0300

ApB gravatar image

This is safe to ignore afaik. And you as a dev can't do something about it. Jolla has to fix this.

edit flag offensive delete publish link more

Comments

I have now reported this internally as JB#35555 and poked the relevant developers about it. Hopefully it'll be fixed soon. Thanks to the OP for raising the issue.

chris.adams ( 2016-06-21 06:00:07 +0300 )edit

This still exists in 3.0.0.8.

Direc ( 2018-11-29 19:29:55 +0300 )edit
Login/Signup to Answer

Question tools

Follow
2 followers

Stats

Asked: 2016-06-17 10:14:06 +0300

Seen: 1,038 times

Last updated: Sep 21 '19