This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-11
Channels
- # announcements (6)
- # architecture (14)
- # babashka (26)
- # beginners (22)
- # calva (11)
- # clj-kondo (2)
- # clj-on-windows (1)
- # cljsrn (10)
- # clojure (116)
- # clojure-europe (5)
- # clojure-uk (1)
- # clojurescript (5)
- # cursive (9)
- # datomic (21)
- # depstar (1)
- # events (1)
- # fulcro (2)
- # graalvm (17)
- # graalvm-mobile (28)
- # helix (3)
- # introduce-yourself (2)
- # jobs (2)
- # lsp (4)
- # meander (1)
- # off-topic (4)
- # pathom (5)
- # polylith (6)
- # practicalli (5)
- # reagent (67)
- # reitit (1)
- # releases (2)
- # shadow-cljs (24)
- # tools-deps (23)
I can't seem to get my cytoscape.js import to work. Ending up with this:
Uncaught TypeError: module$node_modules$cytoscape$dist$cytoscape_esm.cytoscape is not a function
at Object.topology$graph$cytoscape_clj [as cytoscape_clj] (graph.cljs:36)
@jodleif no clue what cytoscape is but I'm guessing you used it wrong. check the translation table and section about default exports here: https://shadow-cljs.github.io/docs/UsersGuide.html#_using_npm_packages
0. (https://cytoscape.org/ visualization library) 1. I've verified that the function it is complaining about exists in the js source shadow-cljs is pointing to 2. I've also verified other npm packages work :man-shrugging: (i.e. calling imported function, getting something back in repl) 3. What's the next step in debugging this? The import seems to work but i'm obviously missing something...
I've read docs and some blog posts you have written
did you try the REPL example here https://shadow-cljs.github.io/docs/UsersGuide.html#_about_default_exports
I really can't help you without seeing code. I can only guess what you are doing. From the error message I'm guessing you used :refer (cytoscape)
when either :as cytoscape
or :default cytoscape
would be correct.
why /js/cytoscape.esm.min
? why not use the npm package? or is that not an npm package?
Just hammer debugging. :default seems promising, I've tried that as well- but maybe repl had dirty state Now:
(cytoscape (clj->js {}))
#object[eo$$module$js$cytoscape_esm_min [object Object]]
Thanks a lot 👍
I see that the https://github.com/thheller/reagent-react-native was updated, but the readme is a bit confusing, would it be all right if I suggest further changes in a PR? E.g. why use both yarn and npm? then how to go twice into the same directory? cd react-native
appears twice.
so, i tried it and it works, i just feel that what i learned is too empirical, don't understand why it works the way it works. not the shadow-cljs part, that's transparent at least, but now I am guessing the yarn install is there so that --legacy-peer-deps is avoided for npm, and I rather use the web interface, but otherwise the watch keeps the terminal, so I see why it's mentioned twice
i also have to run adb devices first for the react native run command to work, this something that start to look like religious rituals : )