2022 Week 27 in Review
planted on in: Week In Review.
~502 words, about a 3 min read.
"Nations that go down fighting rise again, but those who surrender tamely are finished."
— Churchill
This week began with fighting Prisma to work with a MySQL DATE
field that contained 0000-00-00
values, this involved finding out that nodemon wasn't actually compiling my changed code and that I had spent an hour trying to fix the issue without any of my changes actually making it to testing.
Given how long this GitHub issue from 2019 asking for Prisma to support 0000-00-00 00:00:00
for MySQL has been open, the official solution can only be assumed to be "deal with it." I dealt with it by converting all zeroed date values to null
but this isn't ideal, and while I am lucky in being able to transform the legacy database I have inherited, others are not.
Continuing the theme of mild inconveniences, I stumbled into an issue with deploying a Laravel 8 project using Dokku; every page except for the homepage would return an Nginx 404 error response. It took a good ten minutes of head scratching before determining that it hadn't been caused by any changes I had made since my last deploy, nor by recent updates to the Heroku PHP Buildpack.
Annoyingly it wasn't even a new problem, just one that I hadn't noticed before because up til now the project was a single landing page. The problem was caused by my using web: vendor/bin/heroku-php-nginx public/
in my Procfile
instead of web: vendor/bin/heroku-php-apache2 public/
. Laravel ships with a .htaccess
file that configures Apache so it can direct all requests to the public/index.php
file, Nginx doesn't support that config file and so was looking for a .php
file matching the url and not finding one, thus the 404 response.
A quick fix was switching to using Apache, the Heroku documentation explains how to set a custom application level Nginx configuration and the Laravel docs has an example Nginx config for directing all requests to your application's public/index.php
file. I initially chose Nginx out of habit, I may look into this in more detail, or not. It's working now.
Joke of the week
"What does a lemon say when it answers the phone?"
"Yellow!"
Notable Articles Read
- Twitter Thread: Why does iron deficiency cause fatigue, even in the absence of anemia?, also available on thread reader and as a hacker news discussion.
- Apps and advertisers are coming for your lock screen, and it’s going to be exhausting
- It’s 1997 and you want to build a website
Notable Videos Watched
- Ringway Manchester: These Smart Motorway RADAR's Watch Your Every Move!
- Robot Cantina: We put a lawnmower carburetor on our Saturn and then take it on the street.
- DIY Creators: How to Install Laminate Flooring for beginners