This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-06-02
Channels
- # beginners (23)
- # calva (12)
- # cider (4)
- # clj-kondo (4)
- # cljsrn (2)
- # clojure (25)
- # clojure-chicago (1)
- # clojure-italy (6)
- # clojurescript (5)
- # datomic (5)
- # flambo (1)
- # fulcro (16)
- # hoplon (5)
- # joker (2)
- # keechma (45)
- # off-topic (2)
- # pedestal (2)
- # rewrite-clj (13)
- # robots (5)
- # shadow-cljs (62)
- # xtdb (12)
When I save changes from emacs, my "state" (like any atoms that get defined) are all reset. But any "running" go-loops seem to multiply. I'm not sure how to avoid this. If I define an "started-up" atom flag to guard against a go-loop getting spun up more than once, my flag gets reset back to false each time I save changes, so I can't prevent multiple go-loops from starting up. How can I enforce having any go-loop only starting up one time, regardless of how many times I hit save in my editor?
There is defonce
to prevent declaring multiple times. The second time it will reuse the same atom. Might also fix the starting multiple go-loops. Something else to watch out for is having functions executed instead of only defined. So reloading will just update functions and nothing else.
Thanks! I'll give defonce
a try. Not sure I follow the bit about functions executed vs defined on "reload" (does "reload" mean browser reload? or save in editor? or both?)
For example you could have something like (start-loop "foo" "bar")
somewhere but then you start a new loop each time the code reloads. So you want to either start it by some action, or in some file that is not reloaded.
What does this error mean in cider-nrepl while connecting with cider-connect-sibling-cljs
?
@ahmed1hsn that means the embedded server was not started. see https://shadow-cljs.github.io/docs/UsersGuide.html#embedded
@thheller when embedded server is started I don't need to run npx shadow-cljs watch main
?
Because I have already running this command in another shell before runnning cider-connect-sibling-cljs
.
@yenda as far as I know react-native
and/or metro
do not support loading code dynamically
@ahmed1hsn if you have shadow-cljs watch running then you do not need the embedded server. you are likely just not connected to the correct shadow-cljs instance
I don't use emacs so I can't help much. don't know how current this is https://shadow-cljs.github.io/docs/UsersGuide.html#cider
How do I find correct shadow-cljs instance?
It's still giving same errors.
@ahmed1hsn the easiest way is to configure a fixed port for nrepl and connect to that remotely https://shadow-cljs.github.io/docs/UsersGuide.html#nREPL
@yenda hmm it seems to be built directly on require
so no cljs :modules
would not work for that
Are we still not able to disable source map support?
SHADOW import error /Users/matt/.boot/cache/tmp/Users/matt/Projects/cannabit/cannabit-identity/ukm/fyoiyj/app/cljs-runtime/app.server.js
/Users/matt/.boot/cache/tmp/Users/matt/Projects/cannabit/cannabit-identity/ukm/fyoiyj/node_modules/source-map-support/node_modules/source-map/lib/source-map-consumer.js:539
throw new TypeError('Line must be greater than or equal to 1, got '
^
TypeError: Line must be greater than or equal to 1, got null
at BasicSourceMapConsumer.SourceMapConsumer_findMapping [as _findMapping] (/Users/matt/.boot/cache/tmp/Users/matt/Projects/cannabit/cannabit-identity/ukm/fyoiyj/node_modules/source-map-support/node_modules/source-map/lib/source-map-consumer.js:539:13)
at BasicSourceMapConsumer.SourceMapConsumer_originalPositionFor [as originalPositionFor] (/Users/matt/.boot/cache/tmp/Users/matt/Projects/cannabit/cannabit-identity/ukm/fyoiyj/node_modules/source-map-support/node_modules/source-map/lib/source-map-consumer.js:604:22)
at mapSourcePosition (/Users/matt/.boot/cache/tmp/Users/matt/Projects/cannabit/cannabit-identity/ukm/fyoiyj/node_modules/source-map-support/source-map-support.js:199:42)
at wrapCallSite (/Users/matt/.boot/cache/tmp/Users/matt/Projects/cannabit/cannabit-identity/ukm/fyoiyj/node_modules/source-map-support/source-map-support.js:343:20)
at /Users/matt/.boot/cache/tmp/Users/matt/Projects/cannabit/cannabit-identity/ukm/fyoiyj/node_modules/source-map-support/source-map-support.js:378:26
at Array.map (<anonymous>)
at Function.prepareStackTrace (/Users/matt/.boot/cache/tmp/Users/matt/Projects/cannabit/cannabit-identity/ukm/fyoiyj/node_modules/source-map-support/source-map-support.js:377:24)
at process.emit (/Users/matt/.boot/cache/tmp/Users/matt/Projects/cannabit/cannabit-identity/ukm/fyoiyj/node_modules/source-map-support/source-map-support.js:431:52)
at process._fatalException (internal/process/execution.js:123:25)
I am getting this when I try to use express-session
@thheller that seems likely
anyway to disable source maps?
in release I get Maximum call stack exceeded
well it would help to find out whats wrong. :compiler-options {:source-map false}
disables them
shadow$provide[âmodule$node_modules$process_nextick_args$indexâ] = function(global,process,require,module,exports,shadow$shims) { âuse strictâ;
logs show it starts to connect and then complains about a missing function in process.nextTick
well I know why process.nextTick is missing. just need to figure out why its not missing in the cljsjs packages since process.nextTick is usually a node function
it appears to be compiled though. is it an issue of ordering? itâs required at a later stage?
hmm yeah the polyfill is included. you can get the same if you just use (:require ["mqtt/dist/mqtt" :as mqtt])
instead
I should probably update the process polyfill that shadow-cljs includes. seems to be a bit dated by now