This problems surfaces when using nbb with AWS Lambdas where the module and artefacts are invoked directly with nodejs
Problem
When calling the module eg node some-lambda.mjs we see an error like this:
file:///home/ray/fc/repos/card-main/node_modules/nbb/lib/nbb_core.js:2214
2,null),new $APP.G(null,jt,new $APP.G(null,new $APP.G(null,$APP.Ul,new $APP.G(null,D,null,1,null),2,null),null,1,null),2,null),3,null),4,null),5,null),6,null)):null}finally{$APP.Wq()}}).then(function(){var P=$APP.z(a);return hx.h?hx.h(P,b):hx.call(null,P,b)}):Promise.reject(Error(["Could not find namespace: ",$APP.p.g(q)].join("")))}return Promise.resolve($APP.U.g(b))};
^
Error: Could not find namespace: camel-snake-kebab.core
at hx (file:///home/ray/fc/repos/card-main/node_modules/nbb/lib/nbb_core.js:2214:276)
at file:///home/ray/fc/repos/card-main/node_modules/nbb/lib/nbb_core.js:2214:244
at async file:///home/ray/fc/repos/card-main/card-get.mjs:5:21
Countermeasure
We can manually locate the deps using something like this:
find .nbb -type d -name nbb-deps
.nbb/.cache/e4754d38932a5ba3dcbfe8a138680e6ec55900db/nbb-deps
Versions
Minimal reproduction
I have published one here
Context
This problems surfaces when using
nbb
with AWS Lambdas where the module and artefacts are invoked directly withnodejs
Problem
When calling the module eg
node some-lambda.mjs
we see an error like this:Countermeasure
We can manually locate the deps using something like this:
and add that to the module:
This is not a satisfactory countermeasure as the location of the cache can change.
Expected behaviour
The dependencies should be included in the nbb classpath so that we avoid these errors