Hi, I am trying to import http://kepler.gl, unfortunately the library is mixing esm & commonjs imports which results in an error when I try to import them. https://github.com/keplergl/kepler.gl/blob/master/src/localization/index.js#L30 I tried to manually specify the requirements with:
{
...
:js-options
{:resolve {"./fi" {:target :file
:require "node_modules/kepler.gl/dist/localization/fi.js"}}
...}
}
Which resulted in another error:
$jscomp.inherits is not a function
Is there some way to import this library?@thsojka you might need to use webpack. the lib seems to do stuff that shadow-cljs does not support
the inherits you can get rid of by setting :compiler-options {:output-feature-set :es6}
thanks 👍 I’ll try that
something that’s working in regular react native isn’t working in cljsrn run with shadowcljs, making me think that there must be something up with shadow that’s causing it. React Native:
<LottieView
source={require('../components/img/animations/cat-loading.json')}
style={{marginRight: 100, marginLeft: 50}}
autoPlay
loop
/>
In this case I’m seeing the LottieView animation.
Cljs React Native:
[:> LottieView {:source (js/require "../resources/images/loading2.json")
:autoPlay true
:loop true
:style {:height 200
:marginright 200
:marginleft 50}}]
In this case I’m not seeing the LottieView animation. What might be causing this error?In the github of lottie files it’s imported like so:
import LottieView from 'lottie-react-native';
which, according to the shadow user guide translates to: [“lottie-react-native” :default LottieView]
But this gives an error. using :as instead of default doesn’t give an error (but the animation doesn’t show either). Why am I getting an error when using :default when I’m using the direct translation from shadow cljs user guide?
@ps I don't have a clue. I do not use react-native. this looks correct to me except maybe for the path used in the js/require
call. that looks wrong. might also be the :style
map. not exaclty sure how reagent converts that, if at all.