TypeError: Cannot read property 'length' of null

1,296 views
Skip to first unread message

Robin Samways

unread,
Aug 7, 2018, 12:24:31 AM8/7/18
to Chrome DevTools
Hello there,

I am seeing this error when attempting to run a select statement on a table in Google Chrome Developer Tools under the Application tab on WebSql database:

TypeError: Cannot read property 'length' of null

The table in question has many columns. Running a select with some columns works, but not others. Also, a simple "select * from <table_name>" is returning this error.

What is going on? How can a "select *" possibly return such an error?

Thanks..
Robin

Pete Robie

unread,
Aug 10, 2018, 11:26:33 AM8/10/18
to Chrome DevTools
Good morning Robin,

Can you give more detail and possibly the code that you're using that's giving this error? Typically if you're getting the error "can not read property *** of null" then there is something that's typically not defined properly. Without seeing the code it will be incredibly difficult to deduce what the exact problem is.

Additionally 'select * ' is a very bad idea and in general bad practice in an application.

PhistucK

unread,
Aug 10, 2018, 5:10:13 PM8/10/18
to Google Chrome Developer Tools
Robin is using the Developer Tools to inspect web databases, so trying there a select * from query while debugging is perfectly fine.

I can reproduce it as well (see the screenshot below) using the latest canary build on Windows, using the following statements -
CREATE TABLE topic (topic_id TEXT PRIMARY KEY NOT NULL, topic_name TEXT UNIQUE NOT NULL, 'topic description' TEXT)
insert into topic (topic_id, topic_name) values ('1', '1')
select * from topic

However, it does not reproduce if I create the table without the topic description field definition.


You can search crbug.com for an existing issue and star it. If you cannot find one, file a new issue using the "New issue" link on the same page.
Please, do not add a "+1" or "Me too" or "Confirmed" (or similar) comment. It just wastes the time of Chrome engineers and sends unnecessary e-mails to all of the people who starred the issue.

You can reply with a link to the found or created issue and might get triaged (and fixed) faster.

Thank you.


image.png

PhistucK


--
You received this message because you are subscribed to the Google Groups "Chrome DevTools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/e6a9158d-92c7-4ee2-ac29-1ac32eb3ca69%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Robin Samways

unread,
Aug 15, 2018, 8:57:54 AM8/15/18
to Chrome DevTools
Correct, Phistuck. Any clue why they've built their product this way? Very frustrating.

PhistucK

unread,
Aug 15, 2018, 9:23:47 AM8/15/18
to Google Chrome Developer Tools
Well, do you ever have a bug in your code? So do they... It was not intended.

PhistucK


On Wed, Aug 15, 2018 at 3:57 PM Robin Samways <rgsa...@gmail.com> wrote:
Correct, Phistuck. Any clue why they've built their product this way? Very frustrating.

--
You received this message because you are subscribed to the Google Groups "Chrome DevTools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.

Robin Samways

unread,
Sep 29, 2018, 10:39:13 AM9/29/18
to google-chrome-...@googlegroups.com
Hey guys,

Any word on a fix for this? I really need to be able to debug my queries in the dev tools console.

Do I need to define my tables differently to handle this? I build my tables on the fly using javascript. Perhaps I need to define the columns better?

Thanks..
Robin

PhistucK

unread,
Sep 29, 2018, 10:44:28 AM9/29/18
to Google Chrome Developer Tools
Did you search and found or filed an issue at crbug.com like I suggested? Just posting about bugs in the group usually does not get them fixed (unless they are major). Having them filed at crbug.com adds them to the backlog and gets them prioritized.

PhistucK


Robin Samways

unread,
Sep 29, 2018, 12:06:36 PM9/29/18
to google-chrome-...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages