Fork me on GitHub
#sci
<
2021-10-09
>
Kevin10:10:12

Hey, I'm trying to compile scittle.reagent using the bb prod command. When I try to import the js file I get the following error:

Uncaught TypeError: Cannot read property 'h' of undefined
    at scittle.reagent.js:40
    at scittle.reagent.js:65
(anonymous) @ scittle.reagent.js:40
(anonymous) @ scittle.reagent.js:65
If I replace the prod js file with the CDN version (https://cdn.jsdelivr.net/npm/[email protected]/dist/scittle.reagent.js) it does work. bb dev also works. Clojure: 1.10.3.986 Node: v16.10.0 NPM: 7.24.0 Babashka: v0.6.2 Environment: Pop_OS! Linux My end goal is to create my own plugin but I wanted to compile reagent as a test. Any ideas?

borkdude10:10:28

@kevin.van.rooijen you need to include scittle in the HTML first

borkdude10:10:32

before loading reagent

borkdude10:10:56

and you cannot mix locally compiled with CDN assets, you have to use either all of the one or the other

Kevin10:10:08

That might be it then

Kevin10:10:14

(The last point)

borkdude10:10:29

the names in advanced compilation change globally, so you get weird issues of you mix those

Kevin10:10:50

That makes a lot of sense

Kevin10:10:06

Yes that was it 😄

Kevin10:10:35

Pretty obvious issue. I guess I didn't think of it because of them being separate files

Kevin10:10:24

Thanks for the pointer

borkdude20:10:29

or rather :readers can be just a function

mkvlr20:10:40

ah ok, makes sense