This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-04-12
Channels
- # beginners (47)
- # boot (5)
- # bristol-clojurians (1)
- # cider (45)
- # clara (2)
- # cljs-dev (11)
- # cljsrn (47)
- # clojure (169)
- # clojure-brasil (2)
- # clojure-dusseldorf (22)
- # clojure-finland (1)
- # clojure-italy (9)
- # clojure-nl (3)
- # clojure-poland (2)
- # clojure-russia (4)
- # clojure-spec (79)
- # clojure-uk (105)
- # clojurescript (59)
- # core-async (41)
- # cursive (31)
- # datomic (10)
- # devcards (1)
- # duct (6)
- # editors (9)
- # emacs (12)
- # figwheel (1)
- # fulcro (50)
- # java (4)
- # mount (1)
- # off-topic (47)
- # onyx (33)
- # pedestal (1)
- # protorepl (1)
- # re-frame (32)
- # reagent (45)
- # ring-swagger (6)
- # shadow-cljs (100)
- # tools-deps (6)
- # uncomplicate (27)
- # vim (3)
I’m thrashing - started out using cljs-http, but that didn’t respect the HTTP_PROXY/HTTPS_PROXY environment variables
I’m trying to us kvlt, which uses request
under the hood if it detects you’re using Node.js. I thought request respected the HTTP/HTTPS_PROXY env vars, but not currently working QQ
I'm trying to use some libraries from npm, I get some success with react. But when I try to install the graphql, i get
Undefined nameToPath for module$tmp$cljs_issues$node_modules$graphql$index_mjs
.
Repo to reproduce:
https://github.com/souenzzo/cljs-issues
I'm seeing a very odd effect with cljs.repl/dir. It's output is all squashed together onto a single line. If I feed it into with-out-str I can see the newlines again. My emacs config has just undergone major surgery so I could well have broken something, but I can't for the life of me figure out what. (println(with-out-string(dir xx)))
gives me what I would expect from (dir xx)
. Any ideas how I could have broken this? It's not a change in the source of dir, that's been the same for a very long time. Here is the full weirdness:
cljs.user> (dir anh-front.tree)
childchild-with-labelchildrenexpandlabelsmap-datanodenode-dataroottest-tree
nil
cljs.user> (with-out-str (dir anh-front.tree))
"child\nchild-with-label\nchildren\nexpand\nlabels\nmap-data\nnode\nnode-data\nroot\ntest-tree\n"
cljs.user> (println (with-out-str (dir anh-front.tree)))
child
child-with-label
children
expand
labels
map-data
node
node-data
root
test-tree
nil
@soulflyer Out of curiosity, which REPL and ClojureScript version are you using?
It might be worth checking if this occurs at the terminal via lein figwheel
(to isolate it from anything going on in emacs)
Ahh, I can repro the issue as well @soulflyer — in a simple fresh Figwheel project in the terminal
@fj.abanses can't do that with jsloader. well only if it doesn't contain import/export.
Ah , that's the new look I was seeing in lein figwheel. Seems like a big improvement on the old functionality. And emacs uses this too?
I have no clue about emacs and REBL readline, but since Bruce uses emacs, you can be pretty sure it works. 🙂
Hey, I have a problem with my tests when upgrading clojurescript. The last working version of cljs is 1.9.521, with 1.9.542 it fails. This is the failure:
goog.require could not find: tools.money
in logToConsole_
Error: goog.require could not find: tools.money
in require
tools/money.cljs
is my lib I want to test, it's located it src-cljs/tools
, while the test & test runner are in test-cljs/test
. The runner looks like this:
(ns test.test-runner
(:require [test.money-test]
[clojure.test :as t :refer [run-all-tests]]))
(enable-console-print!)
(defmethod t/report [::t/default :end-run-tests] [m]
(when-let [exit (cond (exists? js/phantom) js/phantom.exit
(exists? js/process) js/process.exit)]
(exit (+ (:fail m) (:error m)))))
(run-all-tests)
And the beginning of the test:
(ns test.money-test
(:require [clojure.test :refer [deftest testing is are run-tests]]
[tools.money :as money]))
; ...
Compiling raises no errors or warnings besides replacing cljs.core/zero?
and cljs.core/neg?
, and in the production code everything works fine!
Ah, finally I run the tests with phantomjs app/assets/javascripts/cljs/test.js
clojurescript changelog: https://github.com/clojure/clojurescript/blob/master/changes.md#19542 Google closure compiler changelog: https://github.com/google/closure-compiler/wiki/Releases#april-23-2017-v20170423
The classpath is usually augmented by :source-paths
or somesuch by whatever tooling you are using
cljsbuild is reporting: Compiling ["../../../app/assets/javascripts/cljs/test.js"] from ["src-cljs/tools" "test-cljs"]...
One other suggestion is to go look in your out directory to see if tools.money is there
I’d compare what the out directories look like between when it works and when it fails
There is a clear difference. After removing the target dir, the broken build has a lot less files and the entire tools directory is missing (without deleting the target, it was the same, lein clean
didn't do anything)
@igel What I’m thinking is that, if any of the namespaces that core.money
depends on is requiring cljs.spec
instead of cljs.spec.alpha
, that could cause them to fail to compile. Of course, there should be compiler errors emitted regarding this, but it might be worth checking out that aspect just in case.
I see. But there are no errors or warnings (besides the 2 about replacing two methods, see above) and this lib only requires [clojure.string :as str]
, [goog.string :as gstring]
& [goog.string.format]
. There are however quite a few dependencies defined in the project.clj
for other builds (I'll try tomorrow to remove them)
I'm trying to use two dependencies from cljsjs - https://github.com/cljsjs/packages/tree/master/react-highlight and https://github.com/cljsjs/packages/tree/master/quill. React-highlight uses a library called highlight.js that is an optional dependency of quill. If react-highlight is on the page before quill, everything works fine, but if quill is loaded before react-highlight, I get an error when trying to use quill. Is there a way to force one dependency to always load before another?
@souenzzo @jannis worked on this, I believe you can use a different resolution method to make GraphQL work
Yes. @souenzzo Try passing :package-json-resolution ["browser" "main"]
to the CLJS compiler.
Compile Exception
java.lang.AssertionError: Assert failed: (or (= (:package-json-resolution opts) :webpack) (= (:package-json-resolution opts) :nodejs) (and (sequential? (:package-json-resolution opts)) (every? string? (:package-json-resolution opts))) (not (contains? opts :package-json-resolution)))
I will try to use clj
+ git deps this night.@jannis Using clojurescript from master and :package-json-resolution ["browser" "main"]
, still the same error.
Few more tryies, now I'm with Error: Undefined nameToPath for module$home$souenzzo$new_school$node_modules$react_redux$es$index
due :package-json-resolution ["browser" "main"]
setting
@jannis there is a repo https://github.com/souenzzo/cljs-issues (the repo isn't using cljs on master)
@qqq use type
:
cljs.user=> (def x "string")
#'cljs.user/x
cljs.user=> (= (type x) js/String)
true
Is there anyone interested in participating in the Lisp Game Jam next week using ClojureScript? I'm trying to pair someone looking for a team mate.
Where in cljs.spec.test.alpha/instrument
do functions get replaced with the wrapped spec-checking fn?
@kenny The scope of that may also include up to the outermost doto
there. FWIW, this was revised with 1.10.238 in order to accommodate an issue with multi-arity functions (CLKS-2397).