I am trying to use uber/react-map-gl with Clojurescript. I have added it the project.clj
-
:npm-deps {"@cljs-oss/module-deps" "^1.1.1"
:react-map-gl "^3.3.0-alpha.5"
:react "^16.4.1"}
and npm install
ed it separately. When I require it from my ns -
(:require [react-map-gl :as M
:refer [BaseControl TRANSITION_EVENTS
FlyToInterpolator]])
(js/console.log M)
(js/console.log BaseControl)
(js/console.log M/BaseControl) ;;-> also fails
M
is correctly logged to the console, but drilling into the attributes (such as BaseControl
) throws an Exception -
Exception: ReferenceError:
...$node_modules$react_map_gl$dist$esm$components$base_control is not defined at Object.get BaseControl [as BaseControl] (http://localhost:3449/js/compiled/out/node_modules/react-map-gl/dist/esm/index.js:5:19) at Object.remoteFunction (<anonymous>:2:14)]
A handful of the attributes are accessible (e.g. no exceptions), such as TRANSITION_EVENTS
and FlyToInterpolator
.
I see this bug (which may or may not be relevant), but I am not sure how to proceed or even troubleshoot. Here's a minimal failing example to repro. Any help would be appreciated.
This is not an answer (really just a comment).
I was able to ostensibly get farther by first manually requiring all of the components and overlays (which points to some deps mismanagement of some sort).
You can see that, while this avoids the
...$node_modules$react_map_gl$dist$esm$components$base_control is not defined
error, it is not really a solution as things like:BaseControl
end up beingnil
.You can get a sense of the dependencies at play by making a revision to the compiler to log the results of calls to
cljs.closure/index-node-modules
.My
deps.edn
:and
compile-opts.edn
: