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.

Page crash with Luxon and clearable picker

See original GitHub issue

Environment

Tech Version
material-ui-pickers 2.1.1
material-ui 3.9.0
React 16.7
Browser Chrome 70
Peer library Luxon 1.10.0

Steps to reproduce

  1. Create a clearable picker w/ default value of null
  2. Attempt to change the value

Expected behavior

The new date is stored, and is not null.

Actual behavior

A page crash:

index.esm.js:50 Uncaught TypeError: Cannot read property 'equals' of null
    at LuxonUtils../node_modules/@date-io/luxon/build/index.esm.js.LuxonUtils.isEqual (index.esm.js:50)
    at DateTextField.componentDidUpdate (material-ui-pickers.esm.js:465)
    at commitLifeCycles (react-dom.development.js:15976)
    at commitAllLifeCycles (react-dom.development.js:17262)
    at HTMLUnknownElement.callCallback (react-dom.development.js:149)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:199)
    at invokeGuardedCallback (react-dom.development.js:256)
    at commitRoot (react-dom.development.js:17458)
    at completeRoot (react-dom.development.js:18912)
    at performWorkOnRoot (react-dom.development.js:18841)

Live example

https://codesandbox.io/s/53963ynz0p

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
sakulstracommented, Feb 1, 2019

@dmtrKovalenko actually i think this has to be reopened, the pr i provided only fixed the date clearing, but there seem to be another issues with luxon (setting an initial date)

0reactions
Forfoldcommented, Feb 22, 2019

bump, same thing happening for me with an initial value of null:

luxon.js:6920 Uncaught TypeError: Cannot read property 'isValid' of null
    at DateTime.equals (luxon.js:6920)
    at LuxonUtils.vendorPackages../node_modules/@date-io/luxon/build/index.esm.js.LuxonUtils.isEqual (index.esm.js:50)
    at ProxyComponent.DateTextField.componentDidUpdate (material-ui-pickers.esm.js:465)
    at ProxyComponent.<anonymous> (react-hot-loader.development.js:683)
    at commitLifeCycles (react-dom.development.js:16243)
    at commitAllLifeCycles (react-dom.development.js:17593)
    at HTMLUnknownElement.callCallback (react-dom.development.js:150)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:200)
    at invokeGuardedCallback (react-dom.development.js:257)
    at commitRoot (react-dom.development.js:17789)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Page crash with Luxon and clearable picker · Issue #870
The new date is stored, and is not null. Actual behavior. A page crash: index.esm.js:50 Uncaught TypeError: Cannot read property 'equals' of ...
Read more >
Developers - Page crash with Luxon and clearable picker -
Coming soon: A brand new website interface for an even better experience!
Read more >
React Hook Form + Material UI Datepickers and Luxon ...
Basically, I want to take the value of my outputted DatePicker and TimePicker and format it correctly to send to the backend. I...
Read more >
rc-time-picker-luxon
Name Type Default prefixCls String 'rc‑time‑picker' clearText String 'clear' disabled Boolean false
Read more >
How to Handle Time Zones using DateTime and Luxon
Raise your hand if you've ever had issues dealing with time zones, or even if you've asked, "How do I convert a Date...
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