Fork me on GitHub
#shadow-cljs
<
2020-10-08
>
Ian Chow04:10:40

Hi, not sure if this is a shadow-cljs specific question but... I'm trying to use a js library https://github.com/tambien/Piano but am getting the error message

TypeError: Class constructor _o cannot be invoked without 'new'

(ns myapp.core
  (:require ["@tonejs/piano" :refer (Piano)]))
(Piano.)
I had set :compiler-options :output-feature-set to :es6 with no luck. Any help appreciated. Thanks.

Karol Wójcik07:10:48

Which shadow-cljs version?

Ian Chow07:10:41

2.11.4 Other npm packages seem to work fine.

thheller08:10:33

@ianchow hard to say without full stacktrace. looks like it is something internal in the lib. not something you are actually calling from CLJS.

Ian Chow09:10:28

Ah.. ok. Looks like I have to do more digging. Thanks.

Karol Wójcik11:10:07

How can I include refactor-nrepl in shadow-cljs?

thheller11:10:13

same as everywhere else I presume

Karol Wójcik11:10:12

😄 Ok got it working!

Karol Wójcik11:10:37

Last question though. What should I do to access that function? shadow.loader.load_many

Karol Wójcik11:10:54

I'm getting: Uncaught TypeError: shadow.loader.load_many is not a function

Karol Wójcik11:10:42

Module loader has been added to build: :module-loader true

Karol Wójcik11:10:54

Ahh ok. It should load-multiple.

jacklombard16:10:38

Hello I am trying to connect my chrome extension to the REPL. I can’t connect to that run time and this is the error I get in the websockets tab ["^ ","~:op","~:access-denied"] . Any help would be appreciated.

jacklombard16:10:53

I am using binaryage/chromex and I have connected to the nrepl server and then I’ve done the (shadow/repl :extension) step where extension is the name of the build.

jacklombard16:10:14

Nevermind I was able to resolve this

👍 3
jahson19:10:53

Tried :es3, still no luck. IE throws exception about Object.assign.

thheller19:10:07

@jahson you could include the polyfill externally via https://polyfill.io/v3/

thheller19:10:22

or :compiler-options {:force-library-injection ["es6/object/assign"]}

jahson19:10:46

Yeah, but http://polyfill.io is not an option for me 🙂 Probably I will go with direct require / injection.

Karol Wójcik19:10:53

@jahson you know that you can download full polyfill bundle?

jahson19:10:20

@thheller Thank you for your help anyway.

jahson19:10:29

@karol.wojcik Yeah, I've done polyfills many times in JS, just never did with ClojureScript.

jahson19:10:04

Just wanted to make it more elegant 😉

👍 3