This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-08-13
Channels
- # babashka (10)
- # beginners (27)
- # calva (91)
- # cestmeetup (3)
- # cider (27)
- # clj-kondo (12)
- # cljs-dev (4)
- # clojars (13)
- # clojure (35)
- # clojure-europe (30)
- # clojure-france (3)
- # clojure-houston (1)
- # clojure-nl (11)
- # clojure-norway (29)
- # clojure-spec (23)
- # clojure-sweden (5)
- # clojure-uk (128)
- # clojurescript (69)
- # conjure (44)
- # core-async (27)
- # cursive (13)
- # emacs (9)
- # events (3)
- # fulcro (52)
- # graphql (4)
- # jobs (2)
- # jobs-discuss (46)
- # kaocha (4)
- # luminus (12)
- # nrepl (10)
- # off-topic (29)
- # re-frame (17)
- # reitit (20)
- # remote-jobs (4)
- # rewrite-clj (1)
- # ring (4)
- # rum (13)
- # shadow-cljs (40)
- # sql (1)
- # xtdb (1)
I think I’m having the same issue as @adam678. I have src/cljs/user.cljs
, and in shadow-cljs.edn
, I have :preloads [cljs.user ,,,]
. Using :after-load
pointing to cljs.user/start
in shadow-cljs.edn
doesn’t work, nor does setting ^:dev/after-load
meta on the var.
If I put the after-load function into a namespace that’s not in preloads
, it works.
@thheller Thanks! A small indication in the docs might be useful since it seems to happen at least once in a while
I am sorry if this is documented somewhere: how can use files from npm packages that are located in different folders than the usual ones. I am trying to use this library, https://github.com/projectstorm/react-diagrams but the es6 files are not ont the default dist folder but dist/es6 folders. Anyone got the issue before?
@neo2551 that library does not look usable but you can access any file you want via (:require ["the-npm-package/path/to/whatever.js" :as x])
which would be node_modules/the-npm-package/path/to/whatever.js
just needs to be a real JS file so not typescript, flow, JSX or whatever other dialects there may be
Thanks a lot! My issue is the cross dependency call the correct path so I would need to rewrite the source code... how do you know it is not usable? Thanks a lot for your answer!
well for one https://unpkg.com/react-diagrams gives you an error which is never good
Because I get an error whenever I import the package in typescript otherwise.
a bit of e newbie question: I am getting compilation error with no details, and ns is 1kloc
shadow-cljs - starting via "clojure"
------ ERROR -------------------------------------------------------------------
File: /<...redacted...>/foo.cljc
Error in phase :compilation
--------------------------------------------------------------------------------
what can I do to narrow it down?clj -Sdeps "{:deps {org.clojure/clojurescript {:mvn/version \"1.10.758\"}}}" --main cljs.main --compile bug.core
Caused by: clojure.lang.ExceptionInfo: failed compiling constant: 1/4; clojure.lang.Ratio is not a valid ClojureScript constant. {:constant 1/4, :type clojure.lang.Ratio, :clojure.error/phase :compilation}
weirdly enough, if literal is just ratio 1/4
shadow shows (other) ns errors and warning, but if it is vector with ratio [1/4]
- error is blank, as in previous message@misha I think I fixed that error message recently. which shadow-cljs version do you have? try 2.10.21
I already did. But if you'd like a confirmation newer version would narrow it down too – I'll try it out now
In Chrome DevTools, my "Sources" panel and all Console errors are pointing to files in
, most commonly the core.cljs
file there. Is this normal, or is there a further layer of "source-mapping" I could be enabling to actually get errors to reference my own source files?
I think that's what I mean. My Sources panel in Chrome DevTools is showing this core.cljs
file.
All my runtime errors in the Chrome Console also point to this core.cljs
file, which makes it very difficult for me to track them down in my own source code (e.g. src/app/core.cljs
).
I feel like I'm doing something fundamentally wrong, and I've been trying to grind through guessing where errors come from for a couple months.
This is definitely coming from a place of inexperience with Chrome DevTools. Upon digging through the explosion of error messages in DevTools, I guess I'm able to pick out a file name that looks familiar (only because I happened to have named it views.cljs
, which I recognize). I've highlighted that one in the image below.
And upon clicking on that one, it does indeed take me to the correct source file in the Chrome DevTools. I guess I've just been finding this to be a very harrowing user experience, especially when there are multiple runtime errors and I have to scan through lots of stack trace noise to find where I made the error.
Apologies if this became off-topic, I posted this here because I thought I was doing something wrong with my shadow-cljs configuration. But perhaps I just need some debugging tips, and I can ask elsewhere.