This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-02
Channels
- # announcements (25)
- # babashka (76)
- # beginners (74)
- # biff (36)
- # calva (11)
- # cider (5)
- # clerk (43)
- # cljs-dev (4)
- # cljsrn (12)
- # clojure (111)
- # clojure-austin (14)
- # clojure-europe (82)
- # clojure-nl (2)
- # clojure-norway (5)
- # clojure-uk (1)
- # clojurescript (36)
- # core-async (13)
- # cursive (30)
- # datomic (12)
- # fulcro (6)
- # honeysql (9)
- # hyperfiddle (73)
- # instaparse (3)
- # introduce-yourself (1)
- # membrane (40)
- # nbb (2)
- # off-topic (6)
- # other-languages (9)
- # polylith (33)
- # reagent (2)
- # reitit (7)
- # rum (7)
- # shadow-cljs (47)
- # tools-deps (10)
- # vim (11)
- # xtdb (16)
Hey guys. I have an issue configuring ESM modules.
npx shadow-cljs compile core
shadow-cljs - config: /Users/jakub/Documents/Projects/bizmentor/cljs-calc/shadow-cljs.edn
[:core] Compiling ...
The required namespace "calc.profit-and-loss" is not available.
This is my shadow-cljs.edn
config:
{:source-paths ["src"]
:dependencies []
:builds
{:core
{:target :esm
:output-dir "output"
:modules
{:demo {:exports
{salesGrowthRate calc.profit-and-loss/sales-growth-rate}}}}}}
The file src/calc/profit-and-loss.cljs
:
(ns calc.profit-and-loss)
(defn sales-growth-rate [] "ret")
What am I doing wrong? I read the manual and I thought this is how it should work, but seems like I'm wrong(?)huh, that looks like it should work from the docs.
try adding :entries [calc.profit-and-loss]
to the :demo
module? it shouldn't be necessary
Hey @UCY0GT0QM, thanks. Strangely adding the entries
thing doesn't help.
I'm on the latest shadow-cljs
2.21.0
and shadow-cljs-jar
is 1.3.4
, just installed it.
double-check the file paths, that's there's not like src/main
or something throwing it off.
other thing to try is break the syntax in the file, so it'll error earlier. that'll prove it's getting the right file.
There's actually only that one file
tree src
src
└── calc
└── profit-and-loss.cljs
2 directories, 1 file
I do keep wondering whether I'm doing something stupid, but I don't see anything.
Yep I AM doing something stupid.
clj -A:src
Clojure 1.11.1
user=> (require 'calc.profit-and-loss)
Execution error (FileNotFoundException) at user/eval1 (REPL:1).
Could not locate calc/profit_and_loss__init.class, calc/profit_and_loss.clj or calc/profit_and_loss.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.
Renaming src/calc/profit-and-loss.cljs
to src/calc/profit_and_loss.cljs
did the trick.
I'm new to Clojure...
Hello! I ran into this error when executing "npx shadow-cljs watch app" :
Execution error (AssertionError) at shadow.undertow/eval19463$fn (undertow.clj:145).
Assert failed: (.exists root-dir)
Do you know which directory "root-dir" is supposed to be ? I did not found anything related to this issue
ie :dev-http {3000 "public"}
with public not existing? or an older :http-root
in :devtools
in the build config?
I’m looking at a build report for an app and I’m noticing some classes in the src bundle are way larger in optimized size than the size of the source file itself.. is that number the size of the src file and its required files as well?
if you are talking about cljs code then they'll often be larger yes? especially if you use things like core.async which can generate absurd amounts of code in some cases
Yes its cljs code, aha, ok. Just looking for ways to slim down the bundle size. Also a little confused by I’m seeing re-frame-10x stuff in the build report, I think something is configured incorrectly in my setup
do you follow the example config? https://github.com/day8/re-frame-10x#easy-setup
:release
{:build-options
{:ns-aliases
{day8.re-frame.tracing day8.re-frame.tracing-stubs}}}
being the important bitotherwise you can mouse over the specific source line in the build report. it should tell you what required it
My current best guess is the large bundle size is timezone and date formatting code in the mystery larger classes.. heck like 10% of my bundle size is historical timezone data -_-
code splitting might be an option https://code.thheller.com/blog/shadow-cljs/2019/03/03/code-splitting-clojurescript.html
@maris.orbidans https://shadow-cljs.github.io/docs/UsersGuide.html#_release_specific_vs_development_configuration although :asset-path
usually isn't relevant much in release builds. also why do you have the full URL in there? /cljs
not enough?
Hey. Has anyone seen these: Could not set npm package requirements. Error getting response at
? (Details in the thread.)
I have a project on the latest shadow-cljs
with :target
:esm
and I'm getting this code within deno repl
when I load the generated code into it.
It's rather annoying, I'm hoping to get rid off it, but I'm not understanding where is it coming from.
@maris.orbidans unfortunately not.