framework icon indicating copy to clipboard operation
framework copied to clipboard

case sensitive file names

Open Fil opened this issue 1 year ago • 3 comments
trafficstars

Preview is (most often?) case insensitive, but hosting can be case sensitive. A file attachment named AAPL.csv might be correctly resolved in preview and build, but fail in production.

I'd suggest we make preview and build case sensitive, ~~or (maybe better) we lowercase all filenames.~~

Fil avatar May 17 '24 10:05 Fil

I think this is your operating system (macOS) being case insensitive rather than preview and I don’t think we should do anything here. Forcing all files to be lowercase would likely cause other problems.

mbostock avatar May 17 '24 13:05 mbostock

True, forcing all files to be lowercase is a bad idea (we don't want to have to rewrite scripts that expect to load a file called SoMeThInG.js).

I still think preview (or, and more importantly, build) should help the user catch the issue and break—rather than discovering it in production.

This might mean that we need to compare the list of actual file names ([aapl.csv] in this case) with the list of expected file names ([AAPL.csv])? Needs a bit of investigation.

Fil avatar May 17 '24 14:05 Fil

Yeah we could do some validation during build since we have the full list of files then, and warn if the file cases don’t match what the operating system says when you readdir recursive.

mbostock avatar May 17 '24 14:05 mbostock