This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-12-12
Channels
- # adventofcode (78)
- # announcements (5)
- # babashka (22)
- # beginners (230)
- # calva (18)
- # cider (26)
- # clj-kondo (1)
- # cljs-dev (1)
- # clojure (14)
- # clojure-austin (1)
- # clojure-dev (3)
- # clojure-europe (30)
- # clojure-switzerland (1)
- # clojure-uk (26)
- # clojurescript (33)
- # conjure (2)
- # cursive (2)
- # data-science (1)
- # datomic (9)
- # docker (1)
- # emacs (8)
- # events (4)
- # fulcro (64)
- # lambdaisland (3)
- # luminus (1)
- # off-topic (3)
- # pathom (6)
- # portal (1)
- # programming-beginners (5)
- # shadow-cljs (22)
- # tools-deps (8)
- # xtdb (4)
hello, I bumped shadow in a project and now I'm getting this: Namespace imports (goog:some.Namespace) cannot use import * as. Did you mean to import d3 from 'goog:module$node_modules$d3$dist$d3_node';?
Any idea why? The line it points out have this: import * as d3 from "d3";
@wilkerlucio should be import d3 from "d3"
, unfortunately the closure folks made that change in a strict way. cant' cheat anymore
thanks, that fixes it 🙏
When I compile a small piece of code with
:target :browser
:compiler-options {:output-feature-set :es6}
:js-options {:babel-preset-config {:modules "commonjs"
:targets "chrome > 70"}}
there's always this small JS block in the result (after formatting it):
if ("undefined" !== typeof Symbol) {
var c = Symbol;
"object" != typeof c || !c || c instanceof Array || c instanceof Object || Object.prototype.toString.call(c)
}
It doesn't seem to have any effect and I couldn't find where it comes from.
Do you have any idea?Nope, nothing there as well. Just 5 instances of js/Symbol
usage and none of them seems to be the culprit.
thought it was this one but maybe not https://github.com/clojure/clojurescript/blob/154b19a40e33fb9285bd5c16bc96ec0ab88c4261/src/main/cljs/cljs/core.cljs#L338-L341
So I've recently migrated to shadow-cljs in order to use NPM packages with reagent. I've managed to port over all my previous dependencies from cljsjs, but when I try to use this project: https://github.com/weknowinc/react-bubble-chart-d3 I get an error like this
Assert failed: Component must not be nil
I'm importing as such
(ns goodstats.stats
(:require [reagent.ratom :as ratom]
[reagent.core :as reagent]
[ajax.core :as ajax]
[clojure.edn :as edn]
["@weknow/react-bubble-chart-d3" :refer (BubbleChart)]
["recharts" :as recharts]))
(def BubbleChart (reagent/adapt-react-class BubbleChart))
In the README they say that one needs to import React as the component does not import it, but I assumed Reagent already imported react (since I'm using other react components). Does anyone know what I'm doing wrong?Is that :refer (BubbleChart) on purpose? Instead of :refer [BubbleChart]?
Ah. I just had a look at the npm page and it looks like BubbleChart is the default import So, try :default BubbleChart
maybe try :as BubbleChart as well?
I remember having to do :as Blah when I thought I needed :default Blah
I'd be interested to know how people go about debugging issues like this
one other thing to check is, maybe the import is fine but the issue is caused by something else. After importing it, can you do a (print BubbleChart)? Just to check if it really is nil
Interestingly, this library also does not work for me https://github.com/kauffecup/react-bubble-chart Could the problem be related to d3?
Also, in another dependency I have the following issue:
The required JS dependency "core-js/es6/math" is not available, it was required by "node_modules/recharts/lib/polyfill.js".
Dependency Trace:
goodstats/index.cljs
goodstats/stats.cljs
node_modules/recharts/lib/index.js
node_modules/recharts/lib/polyfill.js
index.cljs
imports all others so I'm able to fix the missing dependency on all but index.cljs
by adding the following to index.cljs
(:require ["core-js/es6/math"])
Resulting in this. And now I don't know how to proceed.
The required JS dependency "core-js/es6/math" is not available, it was required by "goodstats/index.cljs".
Dependency Trace:
goodstats/index.cljs
Interestingly, this library also does not work for me https://github.com/kauffecup/react-bubble-chart Could the problem be related to d3?