This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-12
Channels
- # beginners (63)
- # boot (3)
- # braveandtrue (153)
- # cider (19)
- # cljdoc (2)
- # clojure (80)
- # clojure-dev (25)
- # clojure-italy (73)
- # clojure-losangeles (1)
- # clojure-nl (4)
- # clojure-spec (67)
- # clojure-sweden (1)
- # clojure-uk (83)
- # clojurescript (56)
- # clojutre (11)
- # core-logic (37)
- # cursive (18)
- # datomic (14)
- # editors (10)
- # emacs (13)
- # figwheel-main (11)
- # fulcro (62)
- # graphql (11)
- # jobs (3)
- # klipse (1)
- # leiningen (6)
- # off-topic (91)
- # onyx (7)
- # pedestal (3)
- # portkey (5)
- # re-frame (14)
- # reagent (13)
- # remote-jobs (1)
- # shadow-cljs (111)
- # tools-deps (4)
- # yada (10)
Hi, is there way to add :closure.defines
through shadow/release
function API? I need staging and production release builds and cannot get my head around the configuration. Or is there some better way I do not see?
Well I found archive from 2018-06-20 and yes I did not see it. So ignore previous message.
There's a lib I'm trying to use which default exports a class like so export default class RotatedMarker extends Marker
https://github.com/verdie-g/react-leaflet-rotatedmarker/blob/master/src/RotatedMarker.jsx#L5
however, what's weird is I can't imports it via :default
because I get a shadow require error error but with :as
I don't get the error
anyway short question is is there something different about importing a default export that is like that?
Uncaught TypeError: Super expression must either be null or a function, not object
at _inherits (react-leaflet-rotatedmarker.js:26)
at react-leaflet-rotatedmarker.js:29
at Object.shadow$provide.module$node_modules$react_leaflet_rotatedmarker$lib$react_leaflet_rotatedmarker (react-leaflet-rotatedmarker.js:28)
at Object.shadow.js.jsRequire (shadow.js.js:85)
at Object.shadow.js.require (shadow.js.js:111)
at ken.utils.leaflet_map.js:4
with that file being like so https://gitlab.com/snippets/1753417#L26
@urbanslug what is Marker
? it is not defined anywhere in that file?
So sometimes it works like when I comment out the import of RotatedMarker and just call Marker
any idea how I can get around it? I could whip something up really fast if it'll help
https://github.com/verdie-g/react-leaflet-rotatedmarker/blob/master/src/RotatedMarker.jsx#L2-L3
@urbanslug "but when I clean
" what does this even mean?
add ["react-leaflet-rotatedmarker" :default RotatedMarker]
replace all Marker calls with RotatedMarker
remove/comment out ["react-leaflet-rotatedmarker" :default RotatedMarker]
and replace all RotatedMarker calls with Marker
shadow-cljs recompiles reloads the page and it works as though I'm calling RotatedMarker
clean
then try again... rotation doesn't work
> it fails directly for me just be requiring it Yeah I tried it in the REPL and it failed on me too
well but it magically works when it's commented out and shadow recompiles believe it or not.
like what makes it suddenly work when it's commented out and RotatedMarker calls are replaced with Marker ones
I don't understand? if you comment out the require then it will work yes? the require is what fails?
if I comment the import out and revert RotatedMarker
calls to Marker
, rotation works in the dev server
everything seems deterministic to me? it fails 100% of the time when I try to import react-leaftlet-rotatedmarker
Something like
(:require ["react-leaflet" :refer [Marker]]
["react-leaflet-rotatedmarker" :default RotatedMarker])
[:> RotatedMarker {...}]
react-leaflet
exports an object with many problems which look like they are supposed to be classes
save and recompile shadow does things and rotation works on Marker
(:require ["react-leaflet" :refer [Marker]]
;["react-leaflet-rotatedmarker" :default RotatedMarker]
)
[:> Marker {...}]
now I need to figure out if its a bug in shadow-cljs/closure that Marker
is not a class
$ node
> require("react-leaflet")
ReferenceError: window is not defined
at /mnt/c/Users/thheller/code/shadow-cljs/node_modules/leaflet/dist/leaflet-src.js:230:17
at version (/mnt/c/Users/thheller/code/shadow-cljs/node_modules/leaflet/dist/leaflet-src.js:7:65)
>
fwiw react-leaflet works in the browser for me all the time but react-leaflet-rotatedmarker
is what's weird
like I said it may just be version incompatible but the error looks odd enough so it may be an actual bug
so its just not compatible. maybe react-leaflet changed something since react-leaflet-rotatedmarker
was released
npm package "react-leaflet-rotatedmarker" expected version "react-leaflet@^1.7.8" but "2.0.1" is installed.