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.

Uncaught RangeError: Invalid time value

See original GitHub issue

Describe the bug After loading react-datepicker example into my next.js frontend, tho it renders, if I click any date, it crashes the page and throws the error: Uncaught RangeError: Invalid time value

To Reproduce Steps to reproduce the behavior:

const [date, setDate] = useState(new Date());

    const handleDateChange = date => {
        setDate({ date: date });
    };
<DatePicker className="form-control"
    // value={date}
    selected={date}
    onChange={handleDateChange}
    />

Expected behavior Needs to work! I need to be able to pick a date and not have the page crash.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows/Ubuntu
  • Browser: Chrome

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:12
  • Comments:7

github_iconTop GitHub Comments

6reactions
varunshuklacommented, Apr 29, 2021

I am facing a similar issue. Has anyone found the solution?

4reactions
nacimgouracommented, Jul 12, 2021

This problem is still present, please resolve

Read more comments on GitHub >

github_iconTop Results From Across the Web

RangeError: Invalid time value - javascript
This exception occurs when the Date object contains an invalid date. new Date('undefined').toISOString(). In this example the Date object ...
Read more >
RangeError: invalid date - JavaScript - MDN Web Docs
The JavaScript exception "invalid date" occurs when a string leading to an invalid date has been provided to Date or Date.parse() .
Read more >
I get an error "RangeError: Invalid time value"
I started seeing the error yesterday and looking at the logs we upgraded to 23.1 yesterday as well. There might be a correlation...
Read more >
throw out RangeError('Invalid time value') · Issue #1752
Expected behavior Hello, I want to use the component to select date, but it keeps throwing out Invalid time value error. No idea...
Read more >
RangeError: invalid date - JavaScript
RangeError : invalid date ; The JavaScript exception "invalid date" occurs when a string leading to an invalid date has been provided to...
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