function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nick_JoeNick_Joe 

Aura Component - navigation Issue

Hi Everyone, to navigate from one component to another component.but when I load first time Community Page it does not navigate.then again refresh page, It's work.Navigation Please suggest if anyone had faced this issue in the past or have any idea.
thanks in advance.
here is the code:-

var urlEvent = $A.get("e.force:navigateToURL");
 urlEvent.setParams({
        "url": "/web-version?recordId="+caseId
        });
      urlEvent.fire();
                                        OR

window.location.href = "/web-version?recordId="+caseId;

Both are not working - First Time Naviagtion show error and the refresh page, It's work.
SwethaSwetha (Salesforce Developers) 
HI Nick_Joe,

What is the error message shown when it is not working first time?

See related: 
https://salesforce.stackexchange.com/questions/224824/lightning-navigation-does-not-refresh-the-state-of-components-how-to-fix-a-bug

https://salesforce.stackexchange.com/questions/281996/in-lightning-record-edit-modal-box-is-not-opening-for-first-time-using-a-get

If this information helps, please mark the answer as best.Thank you