zendesk / zendesk_apps_tools

Apache License 2.0
74 stars 38 forks source link

Not reloading on Guide's theme preview #364

Open suzu2469 opened 3 years ago

suzu2469 commented 3 years ago

The preview of my theme is not automatically reflected during theme development in Guide. Updating my theme files does not automatically upload them and the zat theme preview console log is unresponsive. I started experiencing this symptom after updating to macOS BigSur. What should I do?

OS: macOS BigSur 11.4

❯ ruby -v
ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23) [x86_64-darwin20].
RamChilla commented 3 years ago

I'm having the same problem. The theme preview works on the first load. I go back to my editor, make a change, and go back to the browser and refresh, but no changes reflected.

I have to start and stop the preview after every change I would like to test.

alexk-lb commented 3 years ago

Having the same problem, looks like it's been this way for several months. For now the only workaround I've found is the one @RamChilla stated above: starting and stopping zat theme preview every time I make a change.

Edit to note: I'm running Windows 10 and ZAT in Ubuntu/WLS, tried Ruby versions 2.4.1 and 2.7.0.

RamChilla commented 3 years ago

Having the same problem, looks like it's been this way for several months. For now the only workaround I've found is the one @RamChilla stated above: starting and stopping zat theme preview every time I make a change.

Edit to note: I'm running Windows 10 and ZAT in Ubuntu/WLS, tried Ruby versions 2.4.1 and 2.7.0.

yessir, still the same problem. Are you saying that it recently worked on Catalina? Only thing I didn't try was an older MacOS, but unsure how it would affect it using rbenv and bundle. I did try a Ubuntu VM but same results. I've given up trying to get it to work, so I try to get all my definitive markup changes in, start the theme preview, then work on the CSS/JS as those do update on change. Stop the preview, make changes, rinse, repeat as needed. Using a .zat file helps to not input login details every time you start the preview, which was a big help in my workflow.

Sometime, just sometimes, a git commit & push will actually trigger an upload and I get my theme changes, but too far and few between to make it reliable. I've tried a bunch of Ruby versions from 2.3 up using rbenv along with bundle and still no luck.

I'm curious to hear about a proper solution because I actually enjoyed developing on the platform, minus the tooling hurting my feelings though.

alexk-lb commented 2 years ago

I spent a bit more time looking at this and in my case, the live-reload was failing on tokenized assets (e.g. $assets-customfont-woff) in my stylesheet. Commenting out those assets and/or any place they were used as a value in a CSS property fixed the live-reload feature.

This was not the case until recently. I had used the theme preview tool successfully with tokens in the past.

glook commented 2 years ago

I made some changes that can help with this issue https://github.com/zendesk/zendesk_apps_tools/pull/374

token-cjg commented 2 years ago

Hi all, thanks for the issue report for zendesk_apps_tools.

@glook thank you for submitting a candidate fix for this.

https://github.com/zendesk/zendesk_apps_tools/pull/374 has now been merged and released with tag 3.8.7, please advise if this is still an issue while working with zat theme preview.

PaddyMurphy commented 2 years ago

@token-cjg I was having the same issue zat theme preview works until I make a change (I’m using zendesk_apps_tools 3.8.8).

I can confirm the @alexk-lb solution worked for me. I removed all references to $assets in style.css and it works perfectly. Just change to relative links for assets and it works.

running macos 12.3.1 and ruby 2.6.8p205

evenfrost commented 2 years ago

I'm having an issue when using $assets- helpers with fonts completely hangs the local server, and the Zendesk HC page never finishes loading. In the Network tab I see a bunch of pending requests from localhost:4567 that just stay there until I forcefully kill the server and start it again in the new tab.

@font-face {
  font-family: 'Roboto';
  src: local ("Roboto"),
  src: url($assets-roboto-bold-eot);
  src: url($assets-roboto-bold-eot) format('eot'),
  url($assets-roboto-bold-woff) format('woff'),
  url($assets-roboto-bold-ttf) format('truetype'),
  url($assets-roboto-bold-svg) format('svg');
  font-weight: 700;
  font-style: normal;
}
ramybenaroya commented 2 years ago

I am with macOS 12.2, ruby 2.6.9 For me, after updating locally the gem listen to its latest version (3.7.1), the issue was resolved.