This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-12-28
Channels
- # adventofcode (6)
- # beginners (61)
- # boot (1)
- # chestnut (1)
- # cider (18)
- # cljs-dev (1)
- # cljsrn (3)
- # clojure (176)
- # clojure-android (8)
- # clojure-germany (12)
- # clojure-russia (4)
- # clojure-spec (7)
- # clojure-uk (5)
- # clojurescript (28)
- # css (10)
- # cursive (36)
- # datomic (7)
- # devcards (1)
- # docs (8)
- # emacs (17)
- # fulcro (29)
- # hoplon (28)
- # lein-figwheel (3)
- # leiningen (37)
- # lumo (1)
- # off-topic (54)
- # om (6)
- # re-frame (2)
- # reitit (7)
- # ring-swagger (23)
- # shadow-cljs (115)
- # sql (10)
- # uncomplicate (1)
- # unrepl (24)
not sure if this is what’s causing your error, but :as
should be a plain symbol, rather than a vector of symbols - eg.
["pixi.js" :as Pixi]
(`:refer` expects a vector only because you can refer multiple symbols from a namespace)
Uncaught TypeError: Cannot redefine property: default$
at Function.defineProperty (<anonymous>)
at index.js:23
at Array.forEach (<anonymous>)
at Object.shadow$provide.module$node_modules$pixi_js$lib$core$index (index.js:21)
at shadow.js.require (VM2328 shadow.js.js:51)
at Object.shadow$provide.module$node_modules$pixi_js$lib$index (index.js:19)
at Object.shadow.js.require (VM2328 shadow.js.js:51)
at phlox.main.js:10
(anonymous) @ index.js:23
shadow$provide.module$node_modules$pixi_js$lib$core$index @ index.js:21
shadow.js.require @ VM2328 shadow.js.js:51
shadow$provide.module$node_modules$pixi_js$lib$index @ index.js:19
shadow.js.require @ VM2328 shadow.js.js:51
(anonymous) @ phlox.main.js:10
not sure if this is what’s causing your error, but :as
should be a plain symbol, rather than a vector of symbols - eg.
["pixi.js" :as Pixi]
from the screenshot it is doing a forEach
copying the properties from _math
with was require
d above
looks like that is caused by babel? in the repo we have:
export * from './math';
then in the published node_modules
, that has been compiled to
var _math = require('./math');
Object.keys(_math).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _math[key];
}
});
});
Is it possible to specify the host ip for the dev server? I'd like the server to listen on 0.0.0.0 instead of localhost.
@mjmeintjes yes :http {:host "0.0.0.0"}
in the top level, same as :builds
Yeah, just tried it but it seems to only change the ip for the shadow-cljs server, not the dev server.
It would make sense to add a :http-host key under devtools?
you probably only want to configure it once so it would make sense to configure use the top level :host
It is strange, but I used to be able to access the dev server from other machines in a previous version, but since I upgraded it seems to only listen on localhost.
2.0.105 to 2.0.122
removed aleph and switched to undertow recently to optimize startup time and get http2 support
I see. No worries. Do you want any help adding the host option?
No rush. I'll see if I can figure it out and maybe create a PR.
I wanted to tune the dev servers anyways, so I can do that as well then https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/cljs/devtools/server/dev_http.clj#L125
I agree regarding the default, especially since it was that way before. Thanks.
I was surprised to see undertow as a dependency of shadow, knowing there's a http server built-in makes more sense.
https://github.com/thheller/shadow-cljs/wiki/REPL#embedded-dev-only I'm trying to do this, it seems that shadow/start-worker
is not in devtools.api. I tried watch
but ran into an issue where runtime/instance-ref was not set, so I figure I'm doing something wrong.
@mjmeintjes I pushed [email protected]
which changes the default host back to 0.0.0.0
@dominicm if you are using the embedded version you need to manage the runtime somehow
Great! I love the fast release cycles you have. Thank you.
@thheller start-worker got moved into a different namespace I think. There's a get-or-start-worker in api.clj
https://github.com/thheller/shadow-cljs/blob/fafa15c0f0f5bca722853a8a3061f5b3ed81507d/src/main/shadow/cljs/devtools/api.clj#L48-L63 I'll mimic this structure, but where the shutdown is elsewhere.
Is there a version which starts only the websocket server (or just the core requirements).
with-runtime
will use the server created by start!
though so it won’t launch a new runtime
Dec 28, 2017 10:36:35 PM org.xnio.Xnio <clinit>
INFO: XNIO version 3.3.6.Final
IllegalArgumentException XNIO001001: No XNIO provider found org.xnio.Xnio.doGetInstance (Xnio.java:255)
Is this a known, common, mistake?I'm thinking it could be an issue with tools.deps.alpha not resolving dependencies correctly.
❯ boot -d thheller/shadow-cljs -B with-cp --write --file /tmp/bootcpfile
Retrieving maven-metadata.xml from (6k)
Retrieving shadow-cljs-2.0.124.pom from (7k)
Retrieving xnio-nio-3.3.6.Final.pom from (6k)
Retrieving shadow-cljs-2.0.124.jar from (376k)
Retrieving xnio-nio-3.3.6.Final.jar from (113k)
That's interesting.Yeah, the boot classpath file has 2 entries for xnio, and tools.deps.alpha only has one.
tools.deps
definitely has some unresolved issues. there was another issue where it picked an ancient version of clojurescript over a more current one
or basically all CLJ tools except tools.deps, so yeah there are going to be issues. it is still alpha after all 😉
I've got:
(shadow.server/start! {})
(shadow/watch
{:build-id :hoop/app
:target :browser
:output-dir "public/hoop/js"
:asset-path "/public/hoop/js"
:modules {:main {:entries [pro.juxt.hoop.app]}}})
Which is starting a server on 9360, but I can't see the build anywhere, or see any way to access the js, any hints?user=> (def stop (pro.juxt.krei.core/watch))
shadow-cljs - server running at
[:hoop/app] Configuring build.
#'user/stop
This is the only output I see, am I doing something wrong maybe?user=> (shadow.cljs.devtools.server/start! {})
shadow-cljs - server running at
:shadow.cljs.devtools.server/started
(shadow.cljs.devtools.api/compile* {:build-id :hoop/app
:target :browser
:output-dir "public/hoop/js"
:asset-path "/public/hoop/js"
:modules {:main {:entries '[pro.juxt.hoop.app]}}} {})
[:hoop/app] Compiling ...
AssertionError Assert failed: (cljs-util/is-file-instance? cache-root) shadow.cljs.devtools.config/make-cache-dir (config.clj:115)
I guess the exception is lost into the background when it happens during a watch
.