Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
So I found a bug in the theme that I am using and I've been trying to track it and then attempt to fix it.
The problem is that, no matter what code I write in theme.js it is never ever executed, its like, its never updated to the website.
A simple example that I will show you is the following: http://prntscr.com/1qoek29
As you can see I have added a console.log("WTF") right next to the console.log of the theme that prints the theme name and version, and yes, I have tried that with a fresh incognito window, plus by now its been over 30 minutes since I did the edit, and I still can't see it, so no matter what other changes I do to theme.js they never reflect on the actual website, and I can't figure out why that is.
Solved! Go to the solution
This is an accepted solution.
Hello @Darkbound ,
Are you sure the theme you are using use theme.js file?
I think it's not and you have to confirm it from source code.
btw try to add your code console.log("WTF") in theme.min.js
Thanks
This is an accepted solution.
Hello @Darkbound ,
Are you sure the theme you are using use theme.js file?
I think it's not and you have to confirm it from source code.
btw try to add your code console.log("WTF") in theme.min.js
Thanks
Hey Guleria, thanks for the suggestion, I have just tried it, and yes, modifications in the theme.min.js file do work.
Now the question becomes, how do I transfer my modifications from the "normal" theme.js file into the minified one? How do I 'reminify' it?
EDIT: I found it in theme.liquid and changed it from .min.js to the normal theme.js file, and now the console.logs are working and I am guessing I can start digging in for the issue.
My question now becomes, is this the "acceptable" way to do what I want to do? Work on the theme.js, minify it by myself once I am done, and replace the theme.min.js?
Great, you can use unminify or use online tools to minify it like https://javascript-minifier.com/
My question now becomes, is this the "acceptable" way to do what I want to do? Work on the theme.js, minify it by myself once I am done, and replace the theme.min.js?
Yes, no one is going to stop you hahaha
btw write down your changes somewhere so at the time to update the theme you can copy your changes easily to updated theme.
Thanks
Is there an easier way to keep file modifications if I want to update my theme? I way thinking of something like a child file, like theme-child.js that contains all my changes I did to the theme.js and that stays the same if I update?
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025