GanttChart icon indicating copy to clipboard operation
GanttChart copied to clipboard

Winter '20: TypeError: 'set' on proxy: trap returned falsish for property 'class'

Open jclark-dot-org opened this issue 5 years ago • 2 comments

When installed in a Winter '20 org, the component does not work.

Repro steps:

  1. Clone repo
  2. Create a scratch org
  3. Push source to scratch org
  4. Open scratch org. Open "Gantt Chart" app.
  5. Create a new Resource.
  6. Create a new Project.
  7. Click to Add Resource. Select the Resource.
  8. In the Gantt Chart, click a week to assign the resource to the project for that period. Nothing will happen.
  9. Open your browser's Javascript console. You will see an error:
Uncaught (in promise) TypeError: 'set' on proxy: trap returned falsish for property 'class'
    at eval (/lightning/r/Resource__c/a0256000003puG4AAI/modules/c/gantt_chart_resource.js:4)
    at Jn.l (aura_prod.js:27)
    at Array.forEach (<anonymous>)
    at Proxy.l (aura_prod.js:27)
    at eval (/lightning/r/Resource__c/a0256000003puG4AAI/modules/c/gantt_chart_resource.js:4)
    at Array.forEach (<anonymous>)
    at g.setProjects (/lightning/r/Resource__c/a0256000003puG4AAI/modules/c/gantt_chart_resource.js:4)
    at g.set resource (/lightning/r/Resource__c/a0256000003puG4AAI/modules/c/gantt_chart_resource.js:4)
    at g.set (aura_prod.js:3)
    at setHook (aura_prod.js:27)

Pull Request to fix: https://github.com/SalesforceLabs/GanttChart/pull/2

jclark-dot-org avatar Dec 06 '19 22:12 jclark-dot-org

@jclark-dot-org - was this ever resolved? I would love to mess with it in my developer org.

cojilas avatar Mar 05 '20 20:03 cojilas

@jclark-dot-org I fixed this by going to the gantt_chart_resource.js file, add this after line 239 and before line 240:

allocation = Object.assign({}, allocation);

The allocation object is locked, so if you want to be able to change the Objects properties or values, then you need to first clone the Object to allow you to make amendments

tgentet-obrien avatar Nov 09 '20 15:11 tgentet-obrien