1

I created a lightning web component and now I need to check it how it looks on mobile screen. So on my scratch org, I right clicked on my component, inspect element, and I choose the little button on top left "toggle Device Toolbar" to choose which mobile simulator I want.

After doing this, My scratch org do not show my LWC but redirect me to my user profil and impossible to show me my component to work on it and test it.

Getting crazy to find a way to make it work.

The picture I just added shows no LWC, but my profil page once I activated responsive mode on chrome.

Note : I tried to lunch my scratch org on chrome on my mobile (phone) it redirect me to my native browser, so looks like chrome is not happy with salesforce componenets ?

enter image description here

2
  • Could you update the question with screenshot?
    – Raul
    Aug 14, 2020 at 9:54
  • 1
    @Raul Yes, just added a screenshot Aug 14, 2020 at 9:55

2 Answers 2

2

I had the same problem last time and noticed that this was due to summer release. But my use case was different as I was testing lightning communities and had an actual iPad.


Refer this article: Salesforce Mobile Web Experience Retirement

Debugging Lightning components and applications without Mobile Web

You can run your Lightning applications and components using the Salesforce mobile app on your device. Use the mobile app to review issues your applications and components might have on mobile.

In addition, Salesforce has new mobile tooling available to debug Lightning components for mobile. .

  • Download Salesforce mobile app virtual device builds to verify your Lightning components work well on the mobile app.

  • Mobile previews are also available within Microsoft VSCode for local development of Lightning web components

Find out more and get access to these tools at the Mobile Tools page on developer.salesforce.com.

As article suggest, we have the new mobile app emulator for testing the lightning components.

Note: I personally have not used this tool, do share your experience. :)

2

I had a very similar issue. I found the reason to be that the responsive mode in Chrome reports as a mobile device and Lightning is not available there so it redirects to the Classic mode (in your case your profile page).

In order to make the responsive mode work for Salesforce Lightning, you have to tell Chrome to report as a desktop device like so:

How to make Chrome Dev-Tools report as Desktop in responsive mode

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .