This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-07-05
Channels
- # beginners (53)
- # boot (6)
- # braveandtrue (12)
- # cider (50)
- # cljs-dev (24)
- # clojure (60)
- # clojure-finland (1)
- # clojure-ireland (1)
- # clojure-italy (50)
- # clojure-kc (1)
- # clojure-nl (20)
- # clojure-norway (1)
- # clojure-portugal (1)
- # clojure-russia (2)
- # clojure-sanfrancisco (1)
- # clojure-sweden (1)
- # clojure-uk (176)
- # clojurescript (58)
- # cursive (14)
- # datomic (23)
- # emacs (4)
- # events (16)
- # fulcro (35)
- # graphql (48)
- # hyperfiddle (9)
- # jobs (5)
- # mount (4)
- # onyx (13)
- # overtone (1)
- # play-clj (2)
- # re-frame (91)
- # reagent (9)
- # reitit (9)
- # shadow-cljs (102)
- # sql (3)
- # testing (3)
- # tools-deps (3)
------ WARNING #7 --------------------------------------------------------------
File: /Users/calebmacdonaldblack/Projects/medial/test/cljs/medial_web/components/util_test.cljs:1:5
Invalid Filename, got cljs/medial_web/components/util_test.cljs but expected medial_web/components/util_test.cljs (or .cljc)
--------------------------------------------------------------------------------
Any idea how I can get that warning to go away? There is probably a setting I’m missing or something
:source-paths ["src/cljs" "medial-common/src" "src/clj"]
:test-paths ["test/cljs" "test/clj"]
I’m using :lein true
and those options are in project.clj
@caleb.macdonaldblack something must be adding "test"
to the classpath
@thheller When you say something do you mean source-paths or test-paths?
What else can add "test"
to the classpath?
we are using karma
try running lein classpath
and check if /Users/calebmacdonaldblack/Projects/medial/test
is on there
Hmm Im not sure what I’ve done since I sent that message earlier in the day but the warning isn’t showing up anymore
I did change my tests-paths form test
-> test/cljs
but I though I was still getting the warning. Maybe I forgot to restart or something but I’ve definitely no longer getting any warnings. Thanks for the help anyway
I'm trying to follow the shadow-cljs/examples/webpack example, I'm getting require errors, in the output of :npm-module (I output to "node_modules/shadow-cljs") there are many relative require that fail, for example
ERROR in ./js.reagent.core.js
Module not found: Error: Can't resolve './shadow.js.shim.module$react.js' in '/home/hlolli/Documents/visitor/node_modules/shadow-cljs'
@ ./js.reagent.core.js 24:0-43
@ ./visitor.main.js
@ /home/hlolli/Documents/visitor/index.js
@ multi ../webpack-dev-server/client? webpack/hot/dev-server /home/hlolli/Documents/visitor/index.js
ERROR in ./js.reagent.dom.js
Module not found: Error: Can't resolve './shadow.js.shim.module$react_dom.js' in '/home/hlolli/Documents/visitor/node_modules/shadow-cljs'
@ ./js.reagent.dom.js 22:0-47
@ ./js.reagent.core.js
@ ./visitor.main.js
@ /home/hlolli/Documents/visitor/index.js
@ multi ../webpack-dev-server/client? webpack/hot/dev-server /home/hlolli/Documents/visitor/index.js
so I require it explicitly in one of my cljs source file
(:require ["react"]
["react-dom"])
but that wont fly far
symbol shadow.js.shim.module$react already provided by [:shadow.build.classpath/resource "js/shadow.js.shim.module$react.js"], conflict with [:shadow.build.js-support/require "react"]
in general shadow.js.shim.module$react_dom.js
and shadow.js.shim.module$react.js
are just one of hundreds of requires that webpack complains about being missing. I tried https://www.npmjs.com/package/closure-loader if this was a goog.provide issue, didn't make a difference. I guess these files are reachable for shadow-cljs, but are not spit to files. Maybe this is configureable, or :npm-modules for webpack isn't the right build.that one's missing, no reagent.core.js, full stacktrace https://pastebin.com/MjnT4apj
something wrong here?
:public {:target :npm-module
:output-dir "node_modules/shadow-cljs"
:asset-path "/"
;; :source-map true
:module-loader true
:js-options {:resolve
{"scroll" {:target :file
:file "overrides/scroll_index.js"}}
:js-provider :shadow}
:modules {:main {:entries [visitor.main]}}
:compiler-options {;; :source-map true
:source-map true
:infer-externs :auto
;; :optimizations :none
}
;; :devtools {:http-root "public"
;; :http-port 8088
;; :after-load visitor.main/init}
:open-file-command
["emacsclient" "-n" ["+%s:%s" :line :column] :file]}
{:target :npm-module
:output-dir "node_modules/shadow-cljs"
:entries [visitor.main]
:compiler-options {:infer-externs :auto
:source-map true}}
:open-file-command
is not valid in a build config btw. it should be at the top level
I don't know where the js.
in front is coming from. I just tested locally and everything is fine.
ok, maybe I take the example and move my source over... yes no idea, there was a zombie process there, nukeing the dir, npm i...
that was it, I realized there was a zombie ps there screwing with me, if I would have read the shadow-cljs logs I should have realized it, that it was always connecting to a server
now the only error is
ERROR in /home/hlolli/Documents/visitor/index.js
Module not found: Error: Can't resolve 'shadow-cljs/visitor.main' in '/home/hlolli/Documents/visitor'
@ /home/hlolli/Documents/visitor/index.js 1:0-35
@ multi ../webpack-dev-server/client? webpack/hot/dev-server /home/hlolli/Documents/visitor/index.js
basically my webpack configyes, this is now webpack, could be exlusions or lack of includes, just config shit there, I've been changeing it alow
Error: Cannot find module 'shadow-cljs/visitor.main'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
at Function.Module._load (internal/modules/cjs/loader.js:475:25)
at Module.require (internal/modules/cjs/loader.js:598:17)
at require (internal/modules/cjs/helpers.js:11:18)
node_modules/shadow-cljs cleared... now
> require("shadow-cljs/visitor.main")
ReferenceError: window is not defined
at Object.<anonymous> (/home/hlolli/Documents/visitor/node_modules/shadow-cljs/ajax.xml_http_request.js:46:6)
at Module._compile (internal/modules/cjs/loader.js:654:30)
webpack screwing with me I assumeyes, I clear the config and view it over, now it's delivering
ERROR in ./ajax.xml_http_request.js
Module not found: Error: Can't resolve 'xmlhttprequest' in '/home/hlolli/Documents/visitor/node_modules/shadow-cljs'
@ ./ajax.xml_http_request.js 42:160-185
@ ./ajax.core.js
@ ./visitor.main.js
@ /home/hlolli/Documents/visitor/index.js
@ multi ../webpack-dev-server/client? webpack/hot/dev-server /home/hlolli/Documents/visitor/index.js
but it could be anything at this point, will report if Im still stuckok, next error haha
ERROR in ../xmlhttprequest/lib/XMLHttpRequest.js
Module not found: Error: Can't resolve 'child_process' in '/home/hlolli/Documents/visitor/node_modules/xmlhttprequest/lib'
@ ../xmlhttprequest/lib/XMLHttpRequest.js 15:12-36
@ ./ajax.xml_http_request.js
@ ./ajax.core.js
@ ./visitor.main.js
@ /home/hlolli/Documents/visitor/index.js
@ multi ../webpack-dev-server/client? webpack/hot/dev-server /home/hlolli/Documents/visitor/index.js
ERROR in ../xmlhttprequest/lib/XMLHttpRequest.js
Module not found: Error: Can't resolve 'fs' in '/home/hlolli/Documents/visitor/node_modules/xmlhttprequest/lib'
@ ../xmlhttprequest/lib/XMLHttpRequest.js 16:9-22
@ ./ajax.xml_http_request.js
@ ./ajax.core.js
@ ./visitor.main.js
@ /home/hlolli/Documents/visitor/index.js
@ multi ../webpack-dev-server/client? webpack/hot/dev-server /home/hlolli/Documents/visitor/index.js
yes, thought it was bit node targeted there
{:target :npm-module
:output-dir "node_modules/shadow-cljs"
:entries [visitor.main]
:runtime :browser
:compiler-options {:infer-externs :auto
:source-map true}}
like this?might need to kill .shadow-cljs/builds/public
. not sure if changing that nukes the cache
otherwise try setting :compiler-options {:closure-defines {cljs.core/*target* "browser"}}
in the build config
copy https://github.com/JulianBirch/cljs-ajax/blob/master/src/ajax/xml_http_request.cljs to your source path
and replace
(def xmlhttprequest
(if (= cljs.core/*target* "nodejs")
(let [xmlhttprequest (.-XMLHttpRequest (js/require "xmlhttprequest"))]
(goog.object/set js/global "XMLHttpRequest" xmlhttprequest)
xmlhttprequest)
(.-XMLHttpRequest js/window)))
compiled the closure compiler will probably have removed the js/require
call so it wouldn't fail
you mean like these https://shadow-cljs.github.io/docs/UsersGuide.html#_conditional_reading 😉
I used a template to generate a shadow-cljs app but I see this warning, in development
Warning: It looks like you're using a minified copy of the development build of React.
none of my cljs code or deps is minified
any idea why this is happening?
@currentoor it’s harmless (but unfortunately i don’t think you can get rid of it). shadow does some minification that trips that warning, but the warning isn’t accurate. you are using the correct version.
oh ok well that's a relief
thanks!