This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-18
Channels
- # announcements (4)
- # aws (24)
- # babashka (118)
- # babashka-sci-dev (18)
- # beginners (56)
- # calva (2)
- # clojure (54)
- # clojure-dev (8)
- # clojure-europe (25)
- # clojure-gamedev (5)
- # clojure-nl (1)
- # clojure-norway (6)
- # clojure-uk (2)
- # conjure (1)
- # core-async (1)
- # data-science (3)
- # datomic (5)
- # emacs (8)
- # fulcro (4)
- # hyperfiddle (12)
- # interop (1)
- # jackdaw (4)
- # lsp (5)
- # mid-cities-meetup (5)
- # nbb (32)
- # off-topic (21)
- # reitit (5)
- # shadow-cljs (12)
- # sql (8)
- # vim (18)
- # xtdb (9)
Hi folks. I have a packaging question for an AWS lambda using nbb. My handler function runs just fine in a repl on my laptop. I zipped up the top directory including node_modules/ and uploaded it to my shiny new lambda function. When I invoke it for the first time it complains that it cannot load the second namespace in my zip file.
Do you see the log.cljs (which is presumably the namespace you can't load) in the AWS Console?
Hmm, now I'm sure that *.cljs are in the root dir of the zip file. The AWS console is showing my zip file as a folder.
Exactly the contents of index.mjs from https://www.juxt.pro/blog/nbb-lambda#_hello_world
I just shared https://github.com/sirwobin/external-api-cljs with you
thanks. Can you perhaps update the nbb version here? https://github.com/sirwobin/external-api-cljs/blob/main/package.json cc @U04V5V0V4 The nbb version mentioned in the blog is from December 2021. Can this be updated to 0.6.126 or so? I'm afraid it would set people on the wrong foot otherwise
@U1KGF7AG3 And then repeat npm install
, re-zip and then try again
@U1KGF7AG3 OK, this is the fix:
import { loadFile, addClassPath } from 'nbb';
addClassPath('.');
Alright, updated the docs here now: https://github.com/babashka/nbb/blob/main/doc/aws_lambda.md