khusika / FeelIt

A clean, elegant but advanced blog theme for Hugo
https://feelit.khusika.dev
MIT License
164 stars 60 forks source link

[BUG] local preview broken after converting images to webp #51

Closed Sp-cy closed 3 years ago

Sp-cy commented 3 years ago

Describe the bug

After changing a lot of the images in my blog to webp, the local preview in Hugo broke. It was working reasonably well before. Style sheets are not loading neither images in my local preview but they do work in the live site.

Expected behavior

locally built preview should look like almost the live website

Screenshots

firefox_QFSdX20YSV

firefox_BL2WPUcbuv

I do get errors in Firefox's Inspector

firefox_NlH50Qet2G

firefox_Jdet9GcVnz

Build Environment

Preview Environment

Additional Information

Hugo doesn't display any errors in the terminal after getting the hugo serve --disableFastRender command.

Thank you in advance for any help. Love what you have done with this theme. I can FeelIt.

khusika commented 3 years ago

Probably you didn't set the themsDir properly

theme = "FeelIt"
themesDir = "themes"

PS. themesDir depends on your theme location

Sp-cy commented 3 years ago

You were right. The themesDir wasn't setup. I did set it up now and it's still broken. But I'm suspecting it might be a Hugo error because while checking on Edge browser if I got the same errors I realized I get the pages to display if I press "CNTRL + F5". If i reload the page using the reload button or just F5 I still see the broken page. It's really confusing.

khusika commented 3 years ago

You were right. The themesDir wasn't setup. I did set it up now and it's still broken. But I'm suspecting it might be a Hugo error because while checking on Edge browser if I got the same errors I realized I get the pages to display if I press "CNTRL + F5". If i reload the page using the reload button or just F5 I still see the broken page. It's really confusing.

Try to disable PWA for debugging

Sp-cy commented 3 years ago

ok. Just did it. With this in the config file

  # PWA config
  [params.pwa]
    # whether to enable PWA support
    enable = false
    # service-worker version
    version = "1.0.1"

the service worker stays alive in the browser. But after unregistering the service worker in the browser by pressing F12 then going to the Application tab and pressing "Unregister" in the service worker, everything is working smooth again. Same thing worked both in Firefox and Edge Browser. I guess the service worker's cache is messing with the preview when some changes happen. But I really don't know much. This works for me now, thank you for your knowledge. My blog is hosted in https://blog.sp-cy.com/ if you want to check it out, it's mostly goofy gaming posts but with your theme it looks lovely. I guess you can close the issue if you think that un-register the service worker in the browser while previewing is the ideal solution for now. Thanks again!