Notice that we take matches[0] in the source, which is actually wrong for 404 templates if we assume that globby does preserve order: the control repository-provided custom 404 page's path will occur later. I can't verify it, but I'm guessing that occasionally, the results in matches are in the opposite order, hence production flapping between the two.
To be safe I'm taking out the globbing in favor of fs calls and explicit, predictable ordering.
I strongly suspect that our 404 page woes are caused by globby returning results in a somewhat nondeterministic order. This is on production:
Notice that we take
matches[0]
in the source, which is actually wrong for 404 templates if we assume that globby does preserve order: the control repository-provided custom 404 page's path will occur later. I can't verify it, but I'm guessing that occasionally, the results inmatches
are in the opposite order, hence production flapping between the two.To be safe I'm taking out the globbing in favor of
fs
calls and explicit, predictable ordering.This might fix #109 unless it doesn't.