This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-23
Channels
- # announcements (12)
- # beginners (225)
- # calva (7)
- # cider (45)
- # clj-kondo (1)
- # cljdoc (1)
- # cljsrn (3)
- # clojure (112)
- # clojure-dev (45)
- # clojure-europe (6)
- # clojure-finland (2)
- # clojure-india (1)
- # clojure-nl (27)
- # clojure-spec (37)
- # clojure-uk (171)
- # clojurescript (39)
- # core-async (9)
- # cursive (22)
- # datascript (8)
- # datomic (50)
- # emacs (12)
- # figwheel-main (17)
- # fulcro (42)
- # garden (2)
- # hoplon (27)
- # jobs (4)
- # kaocha (8)
- # klipse (2)
- # luminus (2)
- # off-topic (9)
- # perun (33)
- # planck (2)
- # re-frame (9)
- # reagent (48)
- # reitit (5)
- # remote-jobs (1)
- # rum (2)
- # shadow-cljs (23)
- # slack-help (3)
- # spacemacs (18)
- # sql (7)
- # tools-deps (24)
- # unrepl (9)
- # vim (30)
Hi guys. I wanted to use foreign-libs feature with my webpack result file. My purpose is using External Libraries with my Clojurescript project. Reagent with ReactStrap --bootstrap implementation for React--. I have exclude cljsjs.react and cljsjs.react.dom from dependency vector. In cljsbuild, I have give the foreign-libs entry;
[{:file "app/dev/js/bundle.js"
:provides ["cljsjs.react" "cljsjs.react.dom"]
:global-exports {react React
react.dom ReactDOM}}]
But, repl gives me an error, and doesn’t compile my js file.
WARNING: 3 error(s), 0 warning(s)
ERROR: JSC_MISSING_PROVIDE_ERROR. required "module$Users$sckn$projects$business$qulak$desktopnew$node_modules$react$react" namespace never provided at /Users/sckn/projects/business/qulak/desktopnew/app/prod/js/out_front/reagent/core.js line 4 : 0
ERROR: JSC_MISSING_PROVIDE_ERROR. required "module$Users$sckn$projects$business$qulak$desktopnew$node_modules$react$react" namespace never provided at /Users/sckn/projects/business/qulak/desktopnew/app/prod/js/out_front/reagent/impl/component.js line 4 : 0
ERROR: JSC_MISSING_PROVIDE_ERROR. required "module$Users$sckn$projects$business$qulak$desktopnew$node_modules$react$react" namespace never provided at /Users/sckn/projects/business/qulak/desktopnew/app/prod/js/out_front/reagent/impl/template.js line 4 : 0
It’s compiled now. But, when I run the script. It’s telling me;
goog.require could not find: module$Users$sckn$projects$business$qulak$desktopnew$node_modules$react$index
https://github.com/reagent-project/reagent/blob/master/doc/0.8-upgrade.md This page says; Electron integration is unknown…
@mfikes I have done it. Continue with this thread, please. It’s just spamming the main thread.
Cool. So, are you still seeing $node_modules$react$react
embedded in your generated code?
Nope. I have update my foreign-libs value properly. And the problem is gone. One tip: If you want to override some namespaces with external libraries. You don’t have to exclude them from dependencies vector.
@scknkkrer In the long dollar-sign-separated symbols is node_modules
. I'm wondering if it is picking up the dep in there.
My first hunch is whether this is related to https://clojure.atlassian.net/projects/CLJS/issues/CLJS-3082
@scknkkrer Do you have :npm-deps
in your configuration?
It might be worth setting its value to false
if you can, to avoid any interaction with that feature.
@scknkkrer Maybe move your node_modules
out of the way? (Dunno how you can do that for your project.)
(I'd have to look at the code, but I would have thought that with it set to false
the ClojureScript compiler would ignore that directory, not index it, etc.)
@scknkkrer You may also want to do a clean build, especially if your project had node modules as part of the game previously.
Hi! A quick search on jira turns nothing but peek
on empty subvec
s throws exceptions
cljs.user=> (peek (subvec [] 0 0))
#object[Error Error: No item -1 in vector of length 0]
while in clojure it returns nil
.and since subvec are “contagious” in cljs, the exception can arise quite far from the subvec
call
like
cljs.user=> (peek (pop (conj (subvec [] 0 0) 3)))
#object[Error Error: No item -1 in vector of length 1]
Cool. On the surface, looks like an easy fix
$ clj -A:cljs/dev -re node -r
cljs.user=> (peek (subvec [] 0 0))
nil
cljs.user=> (peek (pop (conj (subvec [] 0 0) 3)))
nil
I can cobble together a proper patch with tests, etc. but this might be what is needed https://github.com/mfikes/clojurescript/commit/dd1ba02c8e1987172972411ffe6da1775fcfb518
Well, my first fix above is incorrect. So... but anyway, will put together a proper one.
Yeah, was thinking https://github.com/mfikes/clojurescript/commit/8365485c08123a1b13ccc2b9778dcf82780201a9
@cgrand if you have any trouble with getting in, let me know
@alexmiller I’m in now, the hardest part was figuring out the exit icon is in fact the “log in” icon https://files.slack.com/files-pri/T03RZGPFR-FJYCZT6GG/image.png