5

I have traced the execution of code and as soon as the execution of our code is over it goes straight to an Error from SF. no errors are thrown prior to this and the last line of code executed is

  },

at the end of a function.

SF throws 6 errors in rapid succession:

First Error - We're reporting this as error ID: -985448148

Cannot assign to read only property 'target' of object '#'] Object.n.writable.a.set as target@https://sdmc-sandbox--fsandbox.lightning.force.com/auraFW/javascript/rtepOYea-S8oL5NxS08JXw/aura_prod.js:24:75059 Proxy.eval()@https://sdmc-sandbox--fsandbox.lightning.force.com/resource/1517858704000/jsAssets/js/jquery.payform.js:85:16 Object.setFocus()@https://sdmc-sandbox--fsandbox.lightning.force.com/libraries/ui/panelLib/panelLibCore.js:14:409 HTMLDivElement.eval()@https://sdmc-sandbox--fsandbox.lightning.force.com/libraries/ui/panelLib/panelLibCore.js:8:19

Second Error - We're reporting this as error ID: -1973561471

Cannot assign to read only property 'target' of object '#'] Object.n.writable.a.set as target@https://sdmc-sandbox--fsandbox.lightning.force.com/auraFW/javascript/rtepOYea-S8oL5NxS08JXw/aura_prod.js:24:75059 Proxy.eval()@https://sdmc-sandbox--fsandbox.lightning.force.com/resource/1517858704000/jsAssets/js/jquery.payform.js:85:16

Third, Fourth, Fifth, and Sixth Error - We're reporting this as error ID: -1973561471

Cannot assign to read only property 'target' of object '#'] Object.n.writable.a.set as target@https://sdmc-sandbox--fsandbox.lightning.force.com/auraFW/javascript/rtepOYea-S8oL5NxS08JXw/aura_prod.js:24:75059 Proxy.eval()@https://sdmc-sandbox--fsandbox.lightning.force.com/resource/1517858704000/jsAssets/js/jquery.payform.js:85:16

Fourth Error - We're reporting this as error ID: -1973561471

Cannot assign to read only property 'target' of object '#'] Object.n.writable.a.set as target@https://sdmc-sandbox--fsandbox.lightning.force.com/auraFW/javascript/rtepOYea-S8oL5NxS08JXw/aura_prod.js:24:75059 Proxy.eval()@https://sdmc-sandbox--fsandbox.lightning.force.com/resource/1517858704000/jsAssets/js/jquery.payform.js:85:16

Now, They all seem to be related to the Payform JS but it is working just fine in orgs on API v41. The only difference is the API version (although there may be critical update or configuration differences but not sure if any would cause this)

All the inputs are standard HTML inputs <input aura:id"..."..>

Any clues on what may be going on here or how to fix it? Was there a change in Spring 18 that broke something or requires something different from JS libraries?

Components are all on V40.0 and Locker Service is enabled and has been working prior to API v42

Line 85 of the JS code is

  if (ele.addEventListener != null) {

UPDATE 2-13-2014

So I have narrowed it down to this section of code

_eventNormalize = function(listener) {
    return function(e) {
      if (e == null) {
        e = window.event;
      }
      e.target = e.target || e.srcElement; ******IT ERRORS HERE ON = e.target
      e.which = e.which || e.keyCode;
      if (e.preventDefault == null) {
        e.preventDefault = function() {
          return this.returnValue = false;
        };
      }
      return listener(e);
    };
  };

I also found that using Safari the error does not appear.

The error happens in Chrome on orgs that have been updated to API v42 but not on orgs that are on v41

So something in Orgs upgrading from v41 to v42 causes this error when using chrome browsers only.....

Still working the support back and forth game with SF support without resolution but at least they are trying....

Update 2-15-2018

Unfortunately if your code breaks and the only thing that changes is a salesforce org API version - Org Update - Salesforce will not support that. If one was to read into the response then they do not support any development that is broken by an API update. It used to be that API updates at least did not affect items on previous API versions....I guess the hundreds of thousands we pay them and the fact that it is a production halt is not sufficient to warrant a single phone call from someone above tier 1 that could spend 5 minutes on a screen share to figure out what is going on....

So frustrating.....

  • What is on line 85 of jquery.payform.js? Also, do you have CSP critical update enabled? – JF Paradis Feb 7 '18 at 3:58
  • The line numbers in the error never match up with the lines in the code..Added it to the question though. And yes, CSP is enabled in both the v41 and v42 orgs – Eric Feb 7 '18 at 4:00
  • @Eric Use the developer console (chromes or firefox) to get the line number and it will match up. They don't match up usually because the controller and helper files get combined (and some other stuff at the top also) – Aequitas Feb 7 '18 at 5:10
  • @Aequitas - I was unable to find any error while stepping through the code. The code ends and appears to finish without error then immediately goes to the SF jumble of code to display an error. I must not be setting a breakpoint right somewhere but I will keep trying. Nothing has changed other than the SF Org API version... – Eric Feb 7 '18 at 5:13
  • Thank you Eric. Could give us repro steps (a small section of code)? It seems that jquery.payform.js is trying to change a non-writable "focus" property on an element. In github.com/jondavidjohn/payform/blob/master/dist/…, around line 85, there is a addEventListener. In panelLibCore.js, there is a call to focus(). The problem appears to be related to an issue between payform, panels, and non writable properties. I would love to investigate more with your help. – JF Paradis Feb 7 '18 at 16:05
0

Code issues caused by Salesforce API upgrades / org API updates are not supported by salesforce. If they break your code you are on your own.

Only resolution is to wrap the code in a try catch block and hope the functionality is not needed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.