We've all been there. Some of us live there. You made code changes, and they aren't appearing in the compiled code, the locally-running web environment, or somewhere else you expect them to appear. I'll be using this list to save myself time in the future, and will be adding to it. Leave a comment with your own "Thing to Check" and I might add it!
Do you need to blow away a build folder?
I recently ran into an issue where a Typescript-compiled ./built
folder used to generate a production build wasn't deleting old/renamed files (in the case of a folder restructure or renaming). So what ended up happening was, ./stores/SomeStore.js
and ./stores/SomeStore/index.js
were both files that existed in the build folder, but not my project. I'd make changes to ./stores/SomeStore/index.ts
but when I built for production, the application was still being built with ./stores/SomeStore.js
, and none of my code changes showed up in the application until I deleted .built
and added a deletion step to my build process.
Did you make changes in a build folder?
Build folders often hold compiled versions of source folder code. If you're searching for code in your project and haven't excluded build folders from search, you can easily make the mistake of editing code that will just be overwritten by the source code when you build.
Are you "host filed"?
Are you thinking you're on a live version of an app because the URL shows that? But really you've host-filed yourself and you're proxying your local? Maybe it's time to vi /etc/hosts
and check.
Environment variables obscuring debugging or removing your change?
Maybe you can't see your code change because logging is turned off in certain builds, or something.
Eliezer Steinbock (FrontWork.dev)@elie2222Incredibly annoying when the bug is having set the wrong environment variable. Seems to happen a fair amount 😭
Any tips for catching these sooner? Often a case of something working locally/in testing but not in staging/prod because env vars are different.20:31 PM - 01 Nov 2020
Do you have multiple tabs/windows of the same App open, in different environments?
Have you ever refreshed, over and over, the staging version of an app, when what you meant to check was your local?
Josh Deltener@joshdeltenerI just spent 20 minutes wondering why my code wasn't working, just to find out I was looking at staging instead of local dev. Ug. #toomanytabs #coffee #itsmonday19:51 PM - 20 Jul 2020
Are you in the right terminal window/folder?
Some code needs to be run at a particular path, or from a terminal that has access and permissions to certain tools. Sometimes you have to touch
a certain file to trigger a change, or you might have to spin up a new terminal.
Is there a delay in the view?
Does the code take a while to build after every change? Are you using a viewer that doesn't refresh the data source?
Not me thinking the mutation didn't work but it's really a database viewer with a delay showing the updated table 😭17:37 PM - 14 Jun 2021
Did you save the file before building?
I can't tell you how many times I've rebuilt a project looking for an expected code change before noticing I haven't even saved the file I changed.
Making changes in the right branch? In the right file? In the right folder?
Maybe you've made a change in a feature branch but built the develop branch. Maybe you're working on a file with the right name, but you're in the wrong directory/at the wrong route. Maybe you're literally looking at the wrong file.
Anand Sriraman@anandsriraman@molly_struve I've been guilty of spending hours wondering why my code in test3.py isn't working, then realising I was running test2.py all along 😅19:29 PM - 22 Sep 2020
Does your code change require other database or authentication changes?
Did you misspell something?
Árni St. Sigurðsson@beltiras@stebets Once took a colleague 5 minutes to spot a wrong case of a single letter in an environment variable name in a script. I had been looking for why the build didn't end up in the right place for 5 hours. 🤦♂️04:47 AM - 22 Apr 2020
Did you push your code?
Are you checking build output but assuming build succeeded?
Maybe the build failed and you're still looking at the old application. It's happened to me.
If one of these ended up getting you unstuck, or you have your own Thing to Check, leave it below!
I'm Adam, a web developer, self-published fiction author, and a sometimes somewhat humorous public speaker. I'm new to Dev, and you can follow me here or on Twitter @adamholwerda. I look forward to hearing from you!
Top comments (0)