Open mortenbekditlevsen opened 2 weeks ago
+1 to this - I'm literally just trying to run the vanilla cloud function sample code and running into this.
Update: This appears to be happening on an internally defined 'express' app, so there's no way for us to configure the 'view engine', mening that this will always fail in a way that's hard for the end user to figure out.
My use case is that we have a customer that sends invalid json to an API. We would like to assist them with a concrete example of what goes wrong, but we can't intercept the request body before the error, and due to the res.render()
call, all the user sees is an 'internal server error' even though the data is clearly bad.
Currently I get the following error in my functions logs occationally:
Error: No default engine was specified and no extension was provided.
Reading about
express
, it appears that this is caused when callingrender
without a configuredengine
.In
logger.ts
line 102, there is a call tores.render(...)
.https://github.com/GoogleCloudPlatform/functions-framework-nodejs/blob/acdfd93097331504d77658aa6159673f02f2d698/src/logger.ts#L102
Just dealing with Cloud Functions that can return a result or give an error, leaves me in doubt about where I should configure this engine, and to what, and for what purpose.
Could this error be communicated without the use of
render
? Or alternatively - could you provide guidance about when, where and why the configuration should happen?