Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps from nbb.edn are not in the nbb classpath by default when called by node #270

Closed
raymcdermott opened this issue Nov 1, 2022 · 0 comments

Comments

@raymcdermott
Copy link

Versions

nbb v1.0.139
nodejs 14 | 16 | 18
Linux version 5.4.0-126-generic (buildd@lcy02-amd64-072) (gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)) #142-Ubuntu SMP Fri Aug 26 12:12:57 UTC 2022 (Ubuntu 5.4.0-126.142-generic 5.4.203)

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 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

and add that to the module:

addClassPath(".nbb/.cache/e4754d38932a5ba3dcbfe8a138680e6ec55900db/nbb-deps")

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant