Do code errors on the mobile version affect anything?

Hi ! I’m currently setting up the mobile version of my website. However, I’m running into some weird issues.

First of all, all the code I have runs without a hitch on the desktop version, however, some code doesn’t run or only runs partially on the mobile website. (for instance, formatted text in a repeater works only on the first item, but not on the following)

This has come to make me wonder: do errors in the code on the mobile version affect the well functioning of the latter? What I mean is, I have removed some items from the mobile version, thus some elements that are called in the code can’t be found, and it shows me lots of errors.

I tried fixing that by implementing the following bit of code to concerned code :

import wixWindow from 'wix-window';
if(wixWindow.formFactor === "Desktop"){ }

But it didn’t seem to have fixed anything.

Thanks for the help!

Hi Tristan :raised_hand_with_fingers_splayed:

Yes, removing elements on Mobile that are used in the code can break the code, and cause the page to look weird, I suggest that you hide the elements on Mobile (hide/collapse) them instead of deleting the element on mobile.

Oh okay, that’s unfortunate. Do you know if using the bit of code I mentioned would fix it? Tbh, unhiding objects I have already hidden would break the layout I have made.

@tristan-breon-1 If you’re %100 sure that the element won’t be used in code on mobile, you can safely delete it, alternatively, you can open the mobile editor and set its status to " Collapsed on load ", this will not leave a space in your layout, just drag the “unwanted” elements to the bottom of the page, and design the layout on top, when the page is ready, the “unwanted” elements will be collapsed on the bottom and shift the footer above.