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

Hi,

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: https://serverless-stack.com/chapters/share-code-between-services.html

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://tenant.ap-southeast-2.snowflakecomputing.com/session/v1/login-request?requestId=2d35e0df-416f-46de-b917-9ff5cfc27d09&warehouse=CONSUME_API_WH",“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 ll08226.ap-southeast-2.snowflakecomputing.com",“level”:“TRACE”}
{“message”:"[7:20:16.2016 PM]: h t t ps://tenant.ap-southeast-2.snowflakecomputing.com/queries/v1/query-request?requestId=7df92a90-3f81-46f9-aac1-7e544fda97ad",“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
Jan