question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property 'milliseconds' of null

See original GitHub issue

https://codepen.io/kurdtpage/pen/dEqMXb I am getting data via JSON, which is not shown.

Sometimes (intermittently) FC has problems getting the milliseconds and spits out “Cannot read property ‘milliseconds’ of null”. I have isolated this problem to the following areas: core\main.js:

  • function asRoughMs, sometimes dur is null. Fix: if (dur == null) return 1;
  • around line 4914, DateEnv.prototype.add = function (marker, dur) { the error is at the following line: a[6] += dur.milliseconds;. My fix is to add if (marker == null) marker = new Date(); // Today at the start of the function (seems to work?)
  • the last function, computeActiveRange sometimes dateProfile.minTime is null so getting the property .milliseconds fails

However with these fixes in place, sometimes the calendar will show a blank page

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kurdtpagecommented, May 30, 2019

Stacktrace/output:

Uncaught TypeError: Cannot read property 'years' of null
    at DateEnv.add (core_main.js:4917)
    at i.r (allworkshop.min.js:1)
    at i.buildDayRanges (core_main.js:1541)
    at i.render (allworkshop.min.js:1)
    at i.Component.receiveProps (core_main.js:3961)
    at o.render (allworkshop.min.js:1)
    at o.Component.receiveProps (core_main.js:3961)
    at CalendarComponent.renderView (core_main.js:6331)
    at CalendarComponent.render (core_main.js:6256)
    at CalendarComponent.Component.receiveProps (core_main.js:3961)
DateEnv.add @ core_main.js:4917
r @ allworkshop.min.js:1
(anonymous) @ core_main.js:1541
i.render @ allworkshop.min.js:1
Component.receiveProps @ core_main.js:3961
o.render @ allworkshop.min.js:1
Component.receiveProps @ core_main.js:3961
CalendarComponent.renderView @ core_main.js:6331
CalendarComponent.render @ core_main.js:6256
Component.receiveProps @ core_main.js:3961
Calendar.renderComponent @ core_main.js:6867
Calendar.executeRender @ core_main.js:6827
Calendar.render @ core_main.js:6649
setcal @ workshop.php:370
refreshevents @ workshop.php:751
(anonymous) @ workshop.php:817
setTimeout (async)
(anonymous) @ workshop.php:815
l @ allworkshop.min.js:1
fireWith @ allworkshop.min.js:1
ready @ allworkshop.min.js:1
a @ allworkshop.min.js:1
0reactions
acerixcommented, Aug 12, 2019

If there is still an issue, please provide a way to reproduce it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'getContext' of null, using canvas
Browser load script first but it doesn't find the canvas. ... that you will loop through this every 500 milliseconds (1/2 a second)...
Read more >
Uncaught TypeError: Cannot read property 'setHours' of ...
This error is telling you that the startDate variable is undefined, i.e. it's empty, there's nothing in it.
Read more >
Re: [dc.js users] Cannot read property 'getFullYear' of null
I keep getting the message error "Cannot read property 'getFullYear' of null" coming from the d3.js file: Here is the html code (index.html):....
Read more >
Changelog - Cypress Documentation
All tests will show the time the test ran in milliseconds during cypress run with the ... Cypress no longer throws the error...
Read more >
cannot read property of null (reading 'insertbefore') - You.com
To solve the "Cannot read property 'insertBefore' of null" error, place the JS script tag at the bottom of the body tag, after...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found