Serverless + serverless-bundle + Snowflake = Unsupported type: object at: (shallow)


I’m trying to write an API in NodeJS that pulls data from Snowflake and exposes it through different endpoints. I use the snowflake-promise Snowflake NodeJS driver but I have tried their official one as well.

I also want to use serverless bundle and structure the code according to the principles mentioned here:

Okay long story short as soon as I use serverless-bundle and try to invoke my function locally I receive the very unhelpful error Error: Unsupported type: object at: (shallow). Without serverless-bundle and I don’t experience this issue.

After some digging I found that it might have something to do with Snowflakes OCSP it seems actually to me like that the response is not coming back or something like that.

Here the logging with serverless-bundle
{“message”:"[3:47:36.4736 PM]: h t tp s://",“level”:“TRACE”}
{“message”:"[3:47:36.4736 PM]: Reading OCSP cache file. C:\Users\myuser\AppData\Local\Snowflake\Caches\ocsp_response_cache.json",“level”:“DEBUG”}

Here the output without:
{“message”:"[7:20:16.2016 PM]: Returning OCSP status for certificate 0A199A9492606AB23DB35D27957D24C9 from cache",“level”:“TRACE”}
{“message”:"[7:20:16.2016 PM]: Returning OCSP status for certificate 067F94578587E8AC77DEB253325BBC998B560D from cache",“level”:“TRACE”}
{“message”:"[7:20:16.2016 PM]: Returning OCSP status for certificate 067F944A2A27CDF3FAC2AE2B01F908EEB9C4C6 from cache",“level”:“TRACE”}
{“message”:"[7:20:16.2016 PM]: Returning OCSP status for certificate A70E4A4C3482B77F from cache",“level”:“TRACE”}
{“message”:"[7:20:16.2016 PM]: socket reused = false",“level”:“TRACE”}
{“message”:"[7:20:16.2016 PM]: OCSP validation succeeded for",“level”:“TRACE”}
{“message”:"[7:20:16.2016 PM]: h t t ps://",“level”:“TRACE”}
{“message”:"[7:20:16.2016 PM]: socket reused = true",“level”:“TRACE”}
Executed (null.null): select * from ihc.locations.api_locations limit 5; Elapsed time: 1702ms

I’m not sure if my issue has even to do with serverless-bundle and one of the libraries used.

If anyone has an direction, idea, advise what I could look for I would be very grateful as that issue is driving me a bit nuts.

Please let me know if I’m missing some information.

Many thanks