I also came across Structuring a Real-World Serverless App but that didn’t have a real Git repo for me to study, so I didn’t actually understand how to manage “Sharing code between services”.
For example I’ve created a minimal reproducible example here:
But when I include …/log.js from bar, log.js is unable to discover bar’s package.json. So how does one organise their code base to make it work?
2021-10-15T07:08:11 2021-10-15T07:08:11.687Z undefined ERROR Uncaught Exception {"errorType":"TypeError","errorMessage":"Cannot destructure property 'dir' of 'T.package' as it is undefined.","stack":["TypeError: Cannot destructure property 'dir' of 'T.package' as it is undefined."," at node_modules/esm/esm.js (/var/task/v1/index.js:50982:20)"," at __require (/var/task/v1/index.js:41:44)"," at node_modules/@digitalbazaar/http-client/index.js (/var/
Perhaps some commonJS/requireJS issue, idk. I do know I miss Golang!