Previewing theme changes locally

Return to top

32 Comments

  • Pasquale Errico

    I have a problem, i think, with livereload and ZAT.

    If a launch Zat Theme Preview my pages are unformatted and slowly, the console show this:

    and some others.

    I have allowed the Insecure Content on Chrome and also test with zat theme preview --no-livereload but doesn't work.

    I must work with online data, on our guide, but it seems impossibile!

    There is a work around for this problem?

    Thanks a lot

    1
  • Greg Katechis
    Zendesk Developer Advocacy

    Hi Pasquale! For an issue like this, I would recommend reaching out directly to our Advocacy team so that they can get additional information needed to assist here.

    1
  • Ben

    Just wanted to reach out here to see if anyone has been running into issues with the ZAT when trying to work on themes locally. For some reason it's not picking up changes to template files any more and I have to close down and rerun zat theme preview for every change. 

    One of my team also is getting intermittent issues where it's taking ages to fully spin up with web server which is doubly annoying given the above. 

    1
  • Paweł Porombka

    Hi, I had same problems over 1 year ago. The API for local development is just bad. I created custom solution for it because I spent 2 weeks trying to make it fully work. No chance. Server breaking connection, continuous problems with uploads etc. I created own continuous deployment scripting in Gulp. It is working and I advice to do the same. Zendesk API allowed to do it all by myself.

    1
  • Keith Bottner

    Trying to set this up and the first step is a show stopper, it says:

    1. If not already done, enable API access in your Zendesk Support account by going to Admin > Channels > API.

    However, when I go to Admin > Channels there is no API and there is no way to add API. Did something change in how to configure this?

    1
  • Cheeny Aban
    Zendesk Customer Care

    Hi Keith,

    You can access API by going to Admin(the one that looks like the wheel icon on the left side of the screen)>Channels>API. If you are still unable to see it, you may reach out to our Customer Support so they can have a closer look into your account

     

     

    0
  • Joshua Small

    I have host mapping enabled, and when I navigate to the URL generated by theme preview, I'm redirected to the specified host mapping. When I set the domain to the specified host mapping, navigating to the generated URL still redirects. What is the recommended means of previewing themes when using host mapping?

    0
  • Cheeny Aban
    Zendesk Customer Care

    Hi Joshua,

    When previewing your Help Center, you can also go to your Guide Admin>Themes>Them that you would like to preview> On the preview page, you can choose the Template and the preview role can be changed from end-user to admin

     

    0
  • Trey

    **Never-mind, it's now inexplicably working.**

    Weird. I posted this message on Friday and it's missing now.

    I'm working on setting up my local Zendesk Guide theme so I can make some changes.  I've followed the instructions here, but when I do step 4 "Copy the "Ready" URL in the output and paste it in a browser."  the help center just redirects to my main Guide page.  Am I missing something?

     

    1
  • Gabriele F.
    Zendesk Customer Care
    Hi Trey! As I can see from your last add into the comment this is now self solved and these lead to a temporarily glitch. I'll set this one to Solved status as well, if you're facing some other issue feel free to reach back and we will continue the troubleshooting.
    0
  • Arati C

    Hello, 

    When I  use the command

    zat theme preview

    and enter all the details, the server starts, but then immediately stops with runtime error

      `start_tcp_server': no acceptor (port is in use or requires root privileges) (RuntimeError)  

    What can I do to fix this error?

    Any help appreciated, since I am new to Zendesk.

    Thanks,

    Arati

     

    0
  • Ben

    Is it possible you ran into issues bring the server up before this try? The error suggests that the port is taken by a process already.
    You can get a list of ports using this cmd on linux:
    sudo lsof -i -P -n

    if the Zendesk one is open or in use you can kill the process taking the port using this.
    kill -9 $(lsof -t -i:8080)

    Another option is logging out and back in or a restart to free up the port. 

    2
  • Arati C

    Thank you Ben, it worked, after I restarted the system.

    Next, I am running into issue like Trey above. Even if I am using the "Ready URL" I am being redirected to the main page of my guide and the URL is that of the active Zendesk site. It says it is preview mode, is that the right way like in screenshot? but the URL is not the one which I entered with preview start. Am I missing something?

     

    Thanks,

    Arati

     

    0
  • Ben

    when you visit the ready URL it always redirects back to the homepage and you get the banner you are seeing there. This should mean you are correctly in the preview and edits you make should be reflected now. 

    You can confirm by checking your script assets are coming from local sources. 

     

     

    0
  • Tipene Hughes
    Zendesk Developer Advocacy

    Hi Pawel Przysucha,

    Thanks for reaching out!

    If you’re accessing the theme preview from a browser in which your credentials aren’t saved or you’re not logged in, the preview will still require sign-in if this is a setting in your account.

    Let me know if you have any questions!

    Tipene

    0
  • Gizem Candemir

    Hi Paweł Porombka,

    I just read your comment:
    "The API for local development is just bad. I created custom solution for it because I spent 2 weeks trying to make it fully work. No chance. Server breaking connection, continuous problems with uploads etc. I created own continuous deployment scripting in Gulp. It is working and I advice to do the same. Zendesk API allowed to do it all by myself."


    I'm really curious about how you solved those issues. Would you maybe write a community post that explains how you created your custom solution? I hope so! Thanks :) 

    Or, it would be great if we could get guidance from Zendesk on those issues with ZAT theme preview. It's really slowing down our development :/

    0
  • Greg Katechis
    Zendesk Developer Advocacy

    Hi Gizem! Could you let me know what filesystem you're using? We use the `listen` gem for ZAT, which does have some limitations related to the fs that it's being run on. There is an open PR on the ZAF repo to force polling, which could potentially resolve this, but with it being in maintenance mode right now, it's difficult to get traction on moving that forward. I'll see what I can do though!

    -1
  • Gizem Candemir

    Hi Greg,

    Thanks for taking a look at this! My filesystem seems to be "APFS (Encrypted)".

    I hope you can get the PR moving and that can fix the issues with previewing! 🤞🙏

    0
  • Patrick Lewis
    I was having the same problem as Ben where zat theme preview would work until I made a change. Removing all references to $assets from my stylesheet fixed it for me. See this zendesk_apps_tools thread https://github.com/zendesk/zendesk_apps_tools/issues/364
    1
  • Rajan

    Hello folks,
    I am using Okta to sign in, how to get my password for zat theme preview?

    0
  • CJ Johnson

    I'm in the same situation, you can generate an API token, and use that with /token after your email to generate the preview, Rajan.
    https://support.zendesk.com/hc/en-us/articles/4408889192858-Generating-a-new-API-token
     

    0
  • CJ Johnson

    Since ZAT is no longer supported, this article could use an overhaul. 

    0
  • Brittany Mandel

    Can anyone help me with this error?

    WARNING: Unexpected middleware set after the adapter. This won't be supported from Faraday 1.0.
       Uploading  Failed: the server responded with status 403
    Server error.
    1
  • Greg Katechis
    Zendesk Developer Advocacy

    Hi Brittany! Typically that's an indication that your credentials were incorrect. If you are using an API token, did you append "/token" to your email address? If not, do you have any more information that you can share with us here so we can best assist?

    0
  • Brittany Mandel

    Greg Katechis - I got it working, that said - the preview tool leaves a lot to be desired and functions very poorly.

    0
  • James Rodewig
    Zendesk Documentation Team

    Hi CJ Johnson,

    Thanks for reaching out. I saw your comment:

    Since ZAT is no longer supported, this article could use an overhaul.

    This isn't quite accurate. Although ZAT is in maintenance mode, it's still supported. While we now encourage developers to use ZCLI for app development, ZCLI doesn't currently support theme previews [related docs].

    That said, I'll give this article a review for any other issues. Thanks again. We appreciate the feedback.

    -1
  • Rajan

    Hello Team

    Since ZAT is in maintenance mode and has bugs for previewing the theme locally. What is the other option for local theme preview as ZCLI doesn't support it?

    cc: James Rodewig, CJ Johnson, Greg Katechis

    2
  • Arno (EMEA Partner)

    Having issues with ZAT THEME PREVIEW suddenly, for a week now. Using standard port only. Read about the updates and related problems afterwards, but based on the updates, there should not be any issues anymore with standard port. *.js and *.css files fail to load due failed preflight request, which is unexpected.

    Can someone confirm that your environments are working fine with zat theme preview?

    If so, I need figure out, what it wrong with my own environment.

    0
  • Arno (EMEA Partner)

    It was something to do with default "ip address". By default theme preview / sinatra was listening on 0.0.0.0:4567 as follows, and it seemed to fail after returning just a couple of files of the first page load. After that just empty responses after long delays, which I saw in browser network panel as failed preflight requests.

    == Sinatra (v2.2.3) has taken the stage on 4567 for development with backup from Thin
    2023-02-13 21:22:51 +0200 Thin web server (v1.8.1 codename Infinite Smoothie)
    2023-02-13 21:22:51 +0200 Maximum connections set to 1024
    2023-02-13 21:22:51 +0200 Listening on 0.0.0.0:4567, CTRL+C to stop

    I have no idea whether this had changed at some point, but as installed latest Ubuntu on Windows again and the rest tools according to Zendesk instructions, that that was the default  address again, and with the same problem. 

    This fixed it for me finally - when starting preview, binding it to localhost ip address:

    zat theme preview --bind 127.0.0.1

    I do not know, if this was specific to my environment, but at least you can try this, if run into similar problems.

     

    0
  • Anthony Chiboucas

    I can't even get ZAT working on Ubuntu 22 following:
    https://developer.zendesk.com/documentation/apps/zendesk-app-tools-zat/installing-and-using-zat/ 

    Error: "can't find header files for ruby at /usr/lib/ruby/include/ruby.h

    You might have to install separate package for the ruby development
    environment, ruby-dev or ruby-devel for example."

    Except those aren't even valid gems anymore. Kinda stopped in my tracks here. 

    0

Please sign in to leave a comment.

Powered by Zendesk