This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-10-20
Channels
- # announcements (4)
- # beginners (5)
- # biff (1)
- # calva (2)
- # clj-kondo (32)
- # clojure (50)
- # clojure-czech (6)
- # clojure-europe (14)
- # clojure-nl (1)
- # clojure-norway (77)
- # clojure-uk (2)
- # core-logic (1)
- # cursive (6)
- # datahike (1)
- # datomic (15)
- # emacs (2)
- # events (1)
- # honeysql (1)
- # hyperfiddle (45)
- # introduce-yourself (2)
- # lsp (9)
- # other-lisps (10)
- # overtone (2)
- # polylith (5)
- # practicalli (1)
- # ring (2)
- # shadow-cljs (6)
Hi all, I am trying to compile a project as ESM to use as a cloud function but when I change my project to use ESM and define module an compile it I get the following error:
[:functions] Configuring build.
[:functions] Compiling ...
[:functions] Build failure:
The required JS dependency "os" is not available, it was required by "node_modules/rollbar/src/server/rollbar.js".
Dependency Trace:
avisi/timesheet/cloud_functions/handle_request.cljs
avisi/timesheet/rollbar.cljs
node_modules/rollbar/src/server/rollbar.js
Searched for npm packages in:
/Users/mitkuijp/Development/tracket/node_modules
os is part of the node-libs-browser polyfill package to provide node-native package support
for none-node builds. You should install shadow-cljs in your project to provide that dependency.
npm install --save-dev shadow-cljs
See:
This is my shadow-cljs config:
:functions {:closure-defines {avisi.timesheet.rollbar/GIT_SHA #shadow/env "CIRCLE_SHA1"}
:target :esm
:runtime :node
:output-dir "dist"
:modules {:handle-request {:exports {handlerequestv2 avisi.timesheet.cloud-functions.handle-request/export}}}}
Ah I think I need to change my import provider:
:js-options {:js-provider :import}
Adding this fixes itDoes this not give a nodejs esm package though unfortunately
Now I get in a world of other issues unfortunately