Never create a function named ‘process’ in Shopify!

This is a strange issue that i found in recent month. When i work in a shopify project, I had created a testing function named process. And then I opened the Theme customizer and i wait and wait so long to load. But nothing loading. The view is actually their but the settings, blocks, sections are not loading. So here is the screenshot that I created this same issue in one of my testing store.

See… Nothing is loading. So first i thought OK this is somekind of shopify issue (Becase as we all know, after they release update every 6 month of period these kind of small bugs are keep happening few weeks) So I didnt care that much and complete the testing and i kept that function named “process” without changing anything. (I know that kind of name is lame, but this is only for testing process, and i forgot to change that 🙂 ). Then I moved to another task that same project that i had to create new setting in blog section. How ever when I navigate to that page inside of Theme customizer, the not loading error was not happend. So I thought OK now there is something wrong happening in the error page, So I again load the page that was never loaded. (Actually that was cart page)

Same situation, The error is still their and nothing was loaded. So I opened the dev tools. And there are lot of errors are showing. Firstly, i was frustrated because there was a lot of erros. But I started to keep reading errors. (example below)

So I keep reading the errors, clicking on the file names and so on. And there was a one error keep logging in the console every 5 seconds or something like that. Here is the error.

So first, I thought OK there is a error with NODE_ENV value in shopify side. There is nothing I can do. Because there is no way to use NODE_ENV values in the actual theme code! Right?.

So I opened and check old themes in theme customizer to check are those themes have this same issue. Lucky me was put that “process” function in every recent old theme codes, So every theme that i checked has the same issue !! ):

So I thought ok this is shopify error and they will fix that. I waited 1day and check the next day morning that this issue was fixed. But the bug is still their, So I checked my other clients theme in theme customizer to check this error exists. And there is no issue that i faced!!! Now i understand there is issue in my theme code.

So again I checked my dev tools console and still have that NODE_ENV value error. So I clickd on the code link to view the error. And here it is

The issue was in the file named storefront-modules.9839fa01a681582d3cba19f81b7d8b77d2d9b5b9.js
The issue was in the file named storefront-modules.9839fa01a681582d3cba19f81b7d8b77d2d9b5b9.js

So as long shot i searched the process word in the code and found the function named as “process” and i changed the function name to other value (in this time propper name) and the issue was GONE.

So please, Never ever named a function “process”

Leave a Reply

Your email address will not be published. Required fields are marked *