This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-08-30
Channels
- # announcements (1)
- # beginners (94)
- # calva (12)
- # cider (5)
- # cljdoc (4)
- # cljs-dev (4)
- # clojure (170)
- # clojure-austin (2)
- # clojure-dev (45)
- # clojure-germany (53)
- # clojure-italy (20)
- # clojure-nl (6)
- # clojure-spec (25)
- # clojure-uk (242)
- # clojurescript (161)
- # cursive (16)
- # data-science (3)
- # datomic (20)
- # defnpodcast (6)
- # emacs (40)
- # events (1)
- # fulcro (80)
- # funcool (46)
- # jobs (1)
- # leiningen (23)
- # liberator (2)
- # lumo (43)
- # mount (3)
- # off-topic (21)
- # onyx (1)
- # pedestal (15)
- # re-frame (23)
- # reitit (4)
- # schema (1)
- # sfcljs (1)
- # shadow-cljs (167)
- # spacemacs (1)
- # tools-deps (21)
- # yada (2)
Filed a Github issue: https://github.com/anmonteiro/lumo/issues/421
ā npm i hyperapp ~/tmp/closure
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm WARN You are using a pre-release version of node and things may not work as expected
+ [email protected]
added 1 package from 1 contributor and audited 18 packages in 2.147s
found 0 vulnerabilities
ā lumo ~/tmp/closure
Lumo 1.9.0-alpha
ClojureScript 1.10.238
Node.js v9.11.2
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Exit: Control+D or :cljs/quit or exit
cljs.user=> (def hypapp (js/require "hyperapp"))
#'cljs.user/hypapp
cljs.user=> hypapp
#js {:h #object[Function], :app #object[Function]}
cljs.user=>
I still think that hyperapp is getting compiled in your example. You can also require it like this
cljs.user=> (require '["hyperapp" :as hy])
nil
cljs.user=> hy
#js {:h #object[Function], :app #object[Function]}
cljs.user=>
@hlolli This is targeting a browser, yes. so js/require won't work. I also tried using the string name and that fails to compile.
I notice in your code as well, that you're useing clj maps {}
but it should most defenitely be #js {}
, if you're used to reagent, then behind the scened, all clj maps are converted to json maps.
basically every time when interoping with js libraries, you need js objects. But clj objects for cljs libs.
Yeah, that needs to be fixed, but I'm pretty sure that should at least be a different error.
Here's a github repo if it's easier: https://github.com/jarcane/cljs-on-glitch
pro-tip, you should probably make a macro for this framework hyperapp
, to fill in all the #js etc...
There's also an @hyperapp/html package that provides helper functions for the HTML that's a bit more readable. For now I just wanted to get it working.
@jarcane try using 1.9.0-alpha instead of 1.8.0. There's a lot of work being done on the closure compiler in relation to node modules these days.
I noticed that by doing npm run start
it used the lumo from node_modules, so if you installed lumo 1.9.0-alpha globally, if could still pick up your local lumo 1.8.0, just to rule all out.
Yeah. On glitch it's all only installed locally (you don't get sudo access to the container)
Uncaught TypeError: Cannot read property 'call' of null
at app$main$view (main.cljs?rel=1535621752659:17)
at resolveNode (index.js:5)
at render (index.js:5)
So the require seems to be working there but it's throwing an error in my actual code (the last line of the view function)
Yeah, which means the require is probably working and I'm just bad at JS interop. XD
OK, managed to fix the issues in the CLJS so it at least throws no errors (though it also rendered nothing so ...), but it's odd that it only works locally. I'm wondering if there's a problem with the version of node deployed on Glitch
app@wise-feet:~ 09:52
$ npm -v
5.6.0
app@wise-feet:~ 09:52
$ pnpm -v
2.14.4
app@wise-feet:~ 09:52
$ npx -v
9.6.1
app@wise-feet:~ 09:52
$ node -v
v8.11.4
Damn. Still nothin'. v8.11.4 is the current LTS which is probably why Glitch uses it. May be there's a compatibility issue here. š
There are three versions compiled against, I just don't know if they are all linked to the GitHub releases
But lumo is compiled against three versions, will try to link to them later