I'm running into a vexing issue while developing a personal site in Craft. I have a new Craft 3 site, installed manually. I'm developing live on the server in a dev subdomain. My
.env sets the site to "dev" mode.
It's been awhile since I've worked on a front-end; one thing that's been an issue is either Safari or Craft caches the CSS while I'm coding. To prevent the cache from loading I've used the "ignore the resource cache while loading resources" button in the Network pane of the Webkit inspector. A few times after reloading the page, I begin to get server errors. The server errors are yii exceptions for a missing template of
internal_error.html, which suggests a server error and not a Craft error specifically.
I've searched through the logs and although I can see where Craft throws the exception, I can't see what is causing this. The headers on my network simply say that the main site URL is throwing a 404. My server log says:
[Thu Mar 12 11:29:11.886937 2020] [core:error] [pid 28286] [client xx.xxx.xx.xxx:xxxxx] End of script output before headers: index.php
Thinking this might be a permissions issue I started from scratch with a Composer-installed Craft. All was fine until I used the cache button on the Network pane again, and the errors returned.
If I change the mode to "production" from "dev," the errors go away, and as far as I can see no new error is created in the server or Craft log. So I can develop in production mode but I do find the dev mode useful.
I've manually cleared the cache from
storage/runtime and cleared the generated files in
cpresources. I've also cleared the cache from the backend admin when logged in via production mode. This doesn't have any effect.
I should add the only thing I haven't tried is to disable Safari's caches while running the site in production mode; if it's related I don't want to break the only method I have on working on the site.
Any help here is greatly appreciated!