leoasis / redux-immutable-state-invariant

Redux middleware that detects mutations between and outside redux dispatches. For development use only.
MIT License
937 stars 37 forks source link

Uncaught RangeError: Maximum call stack size exceeded #33

Closed RyanAtViceSoftware closed 6 years ago

RyanAtViceSoftware commented 6 years ago

Hi, I'm getting "Uncaught RangeError: Maximum call stack size exceeded" errors and I'm not seeing circular references in my state. Any ideas on what I should be looking at?

{
  userContext: {},
  items: [
    {
      itemId: 0,
      frontLineItemId: 15,
      name: 'BUD 4/6 CAN 8OZ',
      vendorItemNumber: '00002',
      description: 'BUD 4/6 CAN 8OZ',
      caseUpc: '018200114014',
      um: 'CA',
      supplier: 'InBev',
      frontline: 34.12,
      status: 'Published',
      remarks: 'Remarks for 00002'
    },
    {
      itemId: 1,
      frontLineItemId: 16,
      name: 'LAND SHARK 6/4-16 CANS',
      vendorItemNumber: '00004',
      description: 'LAND SHARK 6/4-16 CANS',
      caseUpc: '00018200962417',
      um: 'CA',
      supplier: 'InBev',
      frontline: 31.12,
      status: 'Published',
      remarks: 'Remarks for 00004'
    },
    {
      itemId: 2,
      frontLineItemId: 17,
      name: 'BUD 12/32 NR',
      vendorItemNumber: '00005',
      description: 'BUD 12/32 NR',
      caseUpc: '00018200110320',
      um: 'CA',
      supplier: 'InBev',
      frontline: 32.12,
      status: 'Draft',
      remarks: 'Remarks for 00005'
    },
    {
      itemId: 3,
      frontLineItemId: 18,
      name: 'BUD 4/6-12 CANS',
      vendorItemNumber: '00007',
      description: 'BUD 4/6-12 CANS',
      caseUpc: '00018200110344',
      um: 'CA',
      supplier: 'InBev',
      frontline: 33.12,
      status: 'Published',
      remarks: 'Remarks for 00007'
    }
  ],
  pricegroups: [
    {
      id: 3,
      name: 'No Tax',
      status: 'ACTIVE',
      description: 'No Tax Zone',
      assignments: 0
    },
    {
      id: 4,
      name: 'Non-Alcs',
      status: 'ACTIVE',
      description: 'Non Alcs Zone',
      assignments: 0
    },
    {
      id: 1,
      name: 'Off Prem',
      status: 'ACTIVE',
      description: 'Off-Premise Zone',
      assignments: 0
    },
    {
      id: 2,
      name: 'On Prem',
      status: 'ACTIVE',
      description: 'On-Premise Zone',
      assignments: 0
    }
  ],
  promotions: [],
  error: {},
  busyIndicator: {
    busyCount: 0
  },
  rightPanel: {
    show: true,
    panelType: 'ITEMS_DETAILS',
    panelProps: {
      rowId: {}
    }
  },
  form: {},
  routing: {
    location: {
      pathname: '/items',
      search: '',
      hash: '',
      key: 'oj6slt'
    }
  }
}
RyanAtViceSoftware commented 6 years ago

I found my issue. It turns out that I was passing a DOM attribute for rightPanel.panelProps.rowId which was a non-serializable type. Would it be hard to update this tool so that it would give better errors and avoid the max call stack in these situations? I don't mind coding it if I can get some guidance on what needs to be done.