Fork me on GitHub
#shadow-cljs
<
2018-08-29
>
kwladyka14:08:15

(:require [clj-macros :refer [slurp]]
            ["web3" :as web3])
cause The required namespace "clj-macros" is not available While I have this file /src/clj_macros.clj which is (ns clj-macros … ) Why?

kwladyka15:08:17

Oh I shoule use :require-macros instead

flyboarder20:08:41

@thheller Im getting weird errors using 2.6.4

flyboarder20:08:46

SHADOW import error /Users/matt/Projects/cannabit/cannabit-pharma/app/cljs-runtime/app.server.js

/Users/matt/Projects/cannabit/cannabit-pharma/app/cljs-runtime/goog.object.object.js:427
  if (obj !== null && key in obj) {
                          ^
TypeError: Cannot use 'in' operator to search for 'path' in undefined

flyboarder20:08:16

compiled without errors

pvillegas1220:08:23

I’m trying to use materialize css in a clojurescript app with shadow-cljs, I’ve already added the dependency, but I’m missing a step to actually use it in the dom

thheller20:08:52

@flyboarder did this work in previous versions? that looks to me like node is complaining about something?

thheller20:08:51

@pvillegas12 shadow-cljs has no support for compiling any css. so whatever you need to do you need to do it manually

pvillegas1220:08:50

@thheller you mean adding a style tag directly to the index.html? Where in the file system do npm dependencies store the css?

thheller20:08:35

I don't know. that depends on the npm library

pvillegas1220:08:10

materialize css, but I guess the question is more general, in a clojurescript app after getting an npm dependency how do I include the js/css?

thheller20:08:50

CSS you are on your own. I have plans for supporting CSS but nothing usable yet.

flyboarder21:08:34

@thheller yeah it all worked previously

flyboarder21:08:16

@thheller shadow-cljs check returns warnings about cljs 1.10

thheller21:08:35

so if you downgrade to 2.6.3 it works?

thheller21:08:49

you are not giving me much information so I can't really help

flyboarder21:08:02

@thheller im not sure what the previous version was, I had used npm

flyboarder21:08:30

I’m digging more….

thheller21:08:59

> shadow-cljs check returns warnings about cljs 1.10

thheller21:08:06

what does this even mean?

thheller21:08:41

maybe I can figure something out if you show me some errors but right now I'm just clueless

flyboarder21:08:34

@thheller sorry, here is a couple examples

flyboarder22:08:13

@thheller I also see a bunch of these:

------ WARNING #33 -------------------------------------------------------------
 File: ~/.m2/repository/degree9/featherscript/0.4.0-SNAPSHOT/featherscript-0.4.0-SNAPSHOT.jar!/feathers/channels.cljs:8:7
 Property on never defined on app
--------------------------------------------------------------------------------

flyboarder22:08:32

In this case app is a symbol for a runtime object

flyboarder22:08:14

Actually I think all the errors involve runtime objects

flyboarder22:08:05

@thheller for the last error above

flyboarder22:08:09

(defn connection [app listener]
  (.on app "connection" listener))

flyboarder22:08:15

^ how should I fix this?

thheller22:08:35

what is app?

flyboarder22:08:42

express server

flyboarder22:08:58

well feathersJS server

thheller22:08:59

then (defn connection [^js app listener] ...)

thheller22:08:38

hmm I get the check warnings in cljs.core as well. maybe the recent closure update changed something

thheller22:08:17

btw are you using lein/deps? do you have :infer-externs turned on?

flyboarder22:08:06

I am using boot and npm

flyboarder22:08:19

I thought infer-externs was for release builds?

thheller22:08:39

check is also for release builds

flyboarder22:08:41

I have been testing with shadow-cljs compile server which compiles without issues

thheller22:08:16

what was the problem again?

flyboarder22:08:38

errors on runtime

thheller22:08:09

and you are sure that you are calling things correctly? I mean you didn't make a change and pass an undefined value somewhere?

flyboarder22:08:31

no everything was working 2 weeks ago when I last compiled the project

thheller22:08:59

so the absolutely only change you did since then is updating only shadow-cljs?

thheller22:08:30

the error looks like you are passing something undefined to goog.object/set

thheller22:08:13

what is the full stacktrace of the error?

flyboarder22:08:30

(defn authentication [^js app]
  (let [conf (obj/get app "auth")
        path (obj/get conf "path")
        app (auth/configure app conf)]
    (auth/service app path)))

flyboarder22:08:39

^this is the authentication function

flyboarder22:08:56

and I can (prn app)

thheller22:08:02

looks like it maybe doesn't have an auth prop?

thheller22:08:04

oh when you upgraded shadow-cljs did you maybe upgrade all your other npm deps as well?

thheller22:08:16

maybe there was a breaking change somewhere in there?

thheller22:08:39

you can also run node --inspect-brk your.js

thheller22:08:46

and then remote debug the exception

flyboarder22:08:26

looks like “2.4.17” was the last version I was using

thheller22:08:41

did you check if it has a auth and path prop?

thheller22:08:26

can't see a reason why that code would work in 2.4.17 but not 2.6.4 so I'm putting my money on other updated npm deps which broke stuff

thheller22:08:26

just validate that app really has the properties you expect it to have

flyboarder23:08:17

@thheller have you seen this yet? java.lang.ClassNotFoundException: com.google.javascript.jscomp.CompilerInput$ModuleType when using shadow-cljs as a library

thheller23:08:39

yes. incompatible closure compiler version.

thheller23:08:10

most often from incompatible/outdated clojurescript versions

flyboarder23:08:18

so I blew away the .m2 directory and its still showing up