Noticed something tonight that took me a while to debug, thought I was taking crazy pills in my dev environment. Not sure if a bug or what...
Issue: If a javascript file 'my-file.js.liquid' exists on shopify, and you try to 'upload my-file.js', ( without the .liquid extension ) ThemeKit will say it is a successful upload but the file without the .liquid ext will not be in theme folder when you look in Shopify admin.
Came about this by working on a client site, optimizing some js. In my GulpFile, I accidentally had it rename a file to vendor.js.liquid. After realizing that the file did not need the .liquid extention, I changed it in my build and continued work. I was then uploading a vendor.js ( without .liquid ext ) and ThemeKit was saying successful upload but everything on the site was breaking. It was only until I went into the themes > dev-theme > edit html did I see it was not uploading the file.
The hard part about fixing this is that to Shopify vendor.js is the compiled version of vendor.js.liquid so the requests are valid because that file exists on the server but is not shown on the web. Did you rename the file while using the watch command? Did you try and fix the theme using replace?
Understood, which is why I wasn't sure if this was a bug or not. e.g. you don't add the .liquid extension when loading the file in liquid.
I will set up a dev store soon that tries to recreate this.
From what I remember, if a file.js.liquid exists, you can't upload a file.js. I did rename while watch was running. I did try stopping watch and using theme replace. I was only able to remedy this by going into the store admin under themes > edit html and manually removing the file.js.liquid file, then resaving my file.js.
Yeah I will have to think about this for a while and talk to the themes api team to see if I can mitigate this a little bit.
Also to be clear, this problem happens with virtually any file that can have both a .extension and .extension.liquid in assets such as styles.css and styles.css.liquid.
I am quite aware thank you.
So I have been talking to the APIs team and they said that it is a bug that you can even upload a file to a compiled file path. So they are going to fix that and I will be able to catch the error, delete the liquid file and re-upload the local file with themekit. I will give you updates when I get them.
@tanema Thanks for the update! Along those lines, are there any formal places to file bug tickets for the APIs team or really anything technical like that that isn't a forum post? I don't think we want the Themekit repo to become a quasi-Themes/Systems technical support. If you want to reply off this ticket, shoot me a message at [email protected].
@chryton no there are no direct contacts to any team. The only reason you have direct contact with me is because of themekit's open source nature.
Okay so there is an upcoming change on shopify that will help me fix this. When the api receives an update action on an asset that is compile it will return a 422 So what I am proposing is that if I can detect that this is what is happening I will:
DELETE on the liquid filecc @hdytsgt This would be good for you to know as well because there was a small amount of traffic coming from motifmate for this kind of action.