Solved

Section edits not updating (stylesheet and javascript)

Picki
Shopify Partner
6 1 19

Hello

Recently, editing on sections of a Shopify theme no longer works. The HTML part works and update well, but it is now impossible to edit the javascript and stylesheet part of a section.


In short, when I edit what is between the tags "{{javascript}}" or "{{stylesheet}}", the changes don't appear on the site. I have been working on this theme for several weeks, but this problem has just appeared.

It's strange.

 

(I know that the "update trigger" happens when we edit the HTML... but it's just not working right now.)


Thanks in advance for helping me.

Accepted Solution (1)

Picki
Shopify Partner
6 1 19

This is an accepted solution.

The problem resolved by itself...

 

I don't know why. If this happens to you, try changing the active theme on your store for another theme. Then come back to your original theme you were working on. This may be the solution.

 

Regardless, the important thing is that it works now. Thanks for the help.

View solution in original post

Replies 4 (4)

ChoosiZon
Shopify Partner
416 66 111

You can try use <style>.....</style> and <javascript >.....</javascript>  tags instead.

Donate
For faster response with a fee pls email to : choositech@outlook.com

Picki
Shopify Partner
6 1 19

This is an accepted solution.

The problem resolved by itself...

 

I don't know why. If this happens to you, try changing the active theme on your store for another theme. Then come back to your original theme you were working on. This may be the solution.

 

Regardless, the important thing is that it works now. Thanks for the help.

mtleonard120
Shopify Partner
1 0 1

Confirmed this is still an issue in 2022. Deploying updates via themekit which include changes within a {% javascript %} tag will sometimes not appropriately reflect on the deployment target until a republish or manually saving the affected file within the admin code editor 2-3 times.

 

I suspect the bundled scripts.js file where all javascript tag content lives is getting server-side cached and is not invalidated as often as it should be.

louisdeb
Shopify Partner
1 0 0

+1

 

I often find edits in {% stylesheet %} not being registered. The hotfix for me is to add a new line at the bottom of the stylesheet every time it happens.