This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-04-09
Channels
- # announcements (4)
- # beginners (44)
- # boot (15)
- # calva (66)
- # cider (66)
- # clojure (75)
- # clojure-austin (4)
- # clojure-europe (2)
- # clojure-finland (1)
- # clojure-italy (3)
- # clojure-nl (10)
- # clojure-russia (3)
- # clojure-sg (1)
- # clojure-uk (109)
- # clojurescript (18)
- # datomic (8)
- # emacs (1)
- # figwheel-main (1)
- # fulcro (5)
- # jobs (1)
- # jobs-discuss (8)
- # kaocha (7)
- # leiningen (11)
- # luminus (2)
- # off-topic (69)
- # pathom (5)
- # re-frame (7)
- # reagent (4)
- # reitit (18)
- # ring-swagger (3)
- # shadow-cljs (123)
- # spacemacs (1)
- # sql (35)
- # tools-deps (89)
- # uncomplicate (3)
- # vim (6)
- # yada (3)
With latest shadow-cljs
(`2.8.29`), I am getting this on shadow-cljs watch
:
/home/manuel/7bridges/code/cinvat-explorer/.shadow-cljs/babel-worker/babel-worker.js:3497
!0,Hg.Ya="cljs.core.async.impl.ioc-helpers/t_cljs$core$async$impl$ioc_helpers243717",Hg.Hb=function(b){return Vb(b,"cljs.core.async.impl.ioc-helpers/t_cljs$core$async$impl$ioc_helpers243717")};return new Hg(a,oe)$
function Oi(a){try{var b=a[0];return b.l?b.l(a):b.call(null,a)}catch(c){if(c instanceof Object)throw b=c,a[6].qb(null),b;throw c;}}function Pi(a,b){b=Hi(b,Ni(function(c){a[2]=c;a[1]=4;return Oi(a)}));return z(b)?(
a[2]=H(b),a[1]=4,vh):null}
^
TypeError: Invalid value used as weak map key
at WeakMap.set (native)
at d (/home/manuel/7bridges/code/cinvat-explorer/.shadow-cljs/babel-worker/babel-worker.js:1790:192)
at /home/manuel/7bridges/code/cinvat-explorer/.shadow-cljs/babel-worker/babel-worker.js:1795:282
at Array.map (<anonymous>)
at /home/manuel/7bridges/code/cinvat-explorer/.shadow-cljs/babel-worker/babel-worker.js:1795:259
at /home/manuel/7bridges/code/cinvat-explorer/.shadow-cljs/babel-worker/babel-worker.js:1700:229
at presets (/home/manuel/7bridges/code/cinvat-explorer/.shadow-cljs/babel-worker/babel-worker.js:1794:267)
at z (/home/manuel/7bridges/code/cinvat-explorer/.shadow-cljs/babel-worker/babel-worker.js:1826:376)
at /home/manuel/7bridges/code/cinvat-explorer/.shadow-cljs/babel-worker/babel-worker.js:1825:87
at e.buildRootChain (/home/manuel/7bridges/code/cinvat-explorer/.shadow-cljs/babel-worker/babel-worker.js:1830:93)
no worries. I trashed the node_modules directory in the root of my project and re-installed the dependencies I need via npm. It works just fine as usual now. Sorry for the noise.
@ouvasam the general way should work? (:require ["react-dates" :as rd])
then in reagent [:> rd/Thing {:foo "bar"} ...]
Hi @thheller, no i can't make it work. It ssems that something change from version 13 and it use react-with-styles I did already try sometimes ago but went with another lib, but i really want to be able to use it.
"As of v13.0.0 of react-dates, this project relies on react-with-styles. If you want to continue using CSS stylesheets and classes, there is a little bit of extra set-up required to get things going. As such, you need to import react-dates/initialize to set up class names on our components. This import should go at the top of your application as you won't be able to import any react-dates components without it."
Normally css should be included via import 'react-dates/lib/css/_datepicker.css'; But i included it in the html with a link tag. When focusing on a field the dom should change, but it is not the case for me
using the :chrome-extension
target, Iām not sure how to setup my background script
my build config:
{:target :chrome-extension
:extension-dir "extension"
:manifest-file "extension/manifest.edn"
:outputs
{:devtools {:output-type :chrome/shared
:init-fn punk.ui.chrome.devtools/init!}
:background {:output-type :chrome/shared
:init-fn punk.ui.chrome.background/init!}
:panel {:output-type :chrome/shared
:init-fn punk.ui.chrome.panel/init!}
}}
relevant manifest.edn:
:background {:persistent false
:scripts ["out/background.js"]}
build config is now:
:background {:output-type :chrome/background
:init-fn punk.ui.chrome.background/init!}
chrome docs say I can just give it a JS file and I think it generates an HTML page for me
FWIW I restarted my shadow-cljs process. Iām now getting errors about websockets. it looks like the background page is trying to connect to the shadow-cljs process
see https://github.com/fulcrologic/fulcro-inspect/blob/master/shells/chrome/manifest.edn#L11-L18
sigh. Iām sorry thheller. I cleared out my .shadow-cljs
and it started working š
Sometimes I have the same problem too, but I'm still not able to reproduce it in a consistent way...
I really need to figure out why is happening for you guys .. I have never had a problem where deleting anything was necessary
the next time I see the startsWith
error, Iāll zip up my builds folder and send it your way
I already identified that problem with the code Wilker sent me, just can't explain how it happens
yeah super strange. I thought it had something to do with switching between diff versions of the closure library
since it was occurring so frequently when we would switch between branches with different shadow-cljs versions
yes that would cause such a problem but the file that triggers the bad behavior should be written correctly always
but in this project, Iāve only ever used latest shadow-cljs. I was modifying shadow-cljs.edn and the manifest.edn, and my new background page exhibited the same behavior
is there any way to change the CLOSURE_BASE_PATH
output by a browser compilation? Iād like it to output a relative path but itās prepending a /
, making it an absolute path and breaking dep resolution
for some reason, in my background script i have a namespace that wonāt load unless I trigger it to compile that namespace
(ns punk.ui.encode
(:require [cljs.reader :as reader]))
(defn write [x]
(prn-str x))
(defn read [x]
(reader/read-string x))
but I donāt see any other load instructions so I might be looking in the wrong place
Can someone translate to a noob what this means and what I should do instead?
[:app] Configuring build.
[:app] Compiling ...
[:app] Build failure:
------ ERROR -------------------------------------------------------------------
File: /Users/d4hines/repos/rectangles/src/rectangles/view.cljs:14:20
--------------------------------------------------------------------------------
11 | (prn fps-div)
12 | (add-watch fps :fps
13 | (fn [k r o n]
14 | (set! (.-innerHtml fps-div (str "<p>" n "<p>")))))
--------------------------^-----------------------------------------------------
Error in phase :compilation
dot prop access with args
{:form (. fps-div -innerHtml (str "<p>" n "<p>"))}
ExceptionInfo: dot prop access with args
I have no idea, but my best guess would be it doesnāt like you passing arguments when trying to access the innerHtml?
(def fps-div (. js/document -getElementById "fps"))
Also fails the same way.
IIRC the .-something was to access a property, and method calls were just (.whatever whatever-youāre-calling-it-on arguments)
I found this on stack overflow, it seems like what youāre trying to attempt. :man-shrugging: I dunno.
Aha! Thanks guys.