I see this error in the function output Fontconfig error: Cannot load default config file: No such file: (null)
I looked into what Fontconfig is and the best I found was this stackoverflow answer about how to setup fontconfig amazon web services - Include custom fonts in AWS Lambda - Stack Overflow, but as described and a few variations it still didn’t render fonts correctly and I still get the same Fontconfig error message in the function log.
Does anyone know how to setup Fontconfig for netlify functions?
Hi @probablycorey, firstly, the reason your function worked locally is because you computer likely has fontconfig installed on it. As far as I can tell, the lambda function environment does not include fontconfig. As such, you would need to include the files needed in your function bundle. I did find an old stackoverflow answer here: amazon web services - Include custom fonts in AWS Lambda - Stack Overflow which seems to show how you could include fonts with your function, though I haven’t tested it out myself.