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.

Always have an error : Failed prop type: Invalid prop `modifiers` of type `Object` supplied to `withStyles(CalendarDay)`, expected instance of `Set`.

See original GitHub issue

Hi,

The minimum REQUIRED setup seems to not work well… What I missed?

The thing is the calendar seems working but I always have an error in console. I don’t know why. It’s the same thing with DateRangerPicker, SingleDatePicker

Help please

class DatePicker extends React.PureComponent {
  constructor(props) {
    super(props);
    this.state = {
      focused: null,
      date: moment(),
    };
  }

  render() {
    return (
      <SingleDatePicker
        date={this.state.date} // momentPropTypes.momentObj or null
        onDateChange={date => this.setState({ date })} // PropTypes.func.isRequired
        focused={this.state.focused} // PropTypes.bool
        onFocusChange={({ focused }) => this.setState({ focused })} // PropTypes.func.isRequired
      />
    );
  }
}
capture d ecran 2018-12-13 a 10 51 31

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
Tamcommented, Feb 21, 2019

I’m also getting Warning: Failed prop type: Invalid prop 'modifiers' of type 'Object' supplied to 'withStyles(CalendarDay)', expected instance of 'Set'. and Warning: Failed prop type: Invalid prop 'modifiers' of type 'Object' supplied to 'CalendarDay', expected instance of 'Set'.

Working my way up the stacktrace, it appears that the default modifiers prop on the compiled CalendarMonth in lib/ is set to an empty object:

var defaultProps = {
  month: (0, _moment["default"])(),
  // ...
  modifiers: {},
  // ...
  verticalBorderSpacing: undefined
};

I don’t know if that’s causing the issue or not.

I’m not polyfilling Set in any way, checking typeof Set === "function" and using Firefox’s toSource() returns function Set() { [native code] }.

3reactions
marcos0xcommented, Jan 30, 2019

I have this error: Failed prop type: Invalid prop modifiers.2019-03-01 of type Set supplied to CalendarMonth, expected instance of Set.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Always have an error : Failed prop type: Invalid prop modifiers ...
I have this error: Failed prop type: Invalid prop modifiers.2019-03-01 of type Set supplied to CalendarMonth , expected instance of Set .
Read more >
Warning: Failed prop type: Invalid prop `label` of type `object ...
The error is telling you everything. "Invalid prop label of type object supplied to Field , expected string." If this is a 3rd-party...
Read more >
invalid prop `rows` of type `object` supplied to `forwardref ...
And have error Warning: Failed prop type: Invalid prop modifiers of type object supplied to ForwardRef(Popper), expected an array.
Read more >
How To Use PropTypes In React - Web Dev Simplified Blog
Warning: Failed prop type: Invalid prop age of type string supplied to Component , expected number . This is great since we can...
Read more >
Warning: Failed prop type: Invalid prop `children` supplied to ...
Warning: Failed prop type: Invalid prop `children` supplied to `ForwardRef(Typography)`, expected a ReactNode. */<Typography key={item.id}>
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