Uncaught RangeError: Invalid time value
See original GitHub issueDescribe 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:
- Created 3 years ago
- Reactions:12
- Comments:7
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I am facing a similar issue. Has anyone found the solution?
This problem is still present, please resolve