Spring19 release:Uncaught (in promise) TypeError

keep getting the following js error in my lightning component after the Salesforce Spring19 release:
Can any one help please

contextService.js:2 Uncaught (in promise) TypeError: Cannot read property 'setParams' of undefined
    at w.get (contextService.js:2)
    at l (contextService.js:2)
    at Object.a.getCacheableContextValue (contextService.js:2)
    at c (navigationService.js:2)
    at new Promise (<anonymous>)
    at d (navigationService.js:2)
    at g.navigateTo (navigationService.js:2)
    at Object.navigate (navigation.js:3)
    at navigate (navigation.js:2)
    at J.Tc (aura_prod.map.js:22316)

Component:

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" controller="newOrderController">


<lightning:navigation aura:id="navLink"/>

<lightning:button label="test" title="test" onclick="{!c.goToRec}" variant="success"/>

Controller:

goToRec : function(component, event, helper) {
        var navLink = component.find("navLink");

        console.log(navLink);
        var pageRef = {
            type: 'standard__recordPage',
            attributes: {
                actionName: 'view',
                objectApiName: 'Order',
                recordId : '80161000002kILkAAM'  
            },
        };


        navLink.navigate(pageRef, true);
    },

Answer

I enabled some critical updates in the system and that resolved it. I can’t remember which exact one I did though.

Setup -> Critical Updates

Attribution
Source : Link , Question Author : Liang , Answer Author : dphil

Leave a Comment