Fork me on GitHub
#joyride
<
2023-08-23
>
pinkfrog05:08:08

Hi. I define some functions in "util.js", and in another file "a.js", I "require "util.js". The functions in "util.js" has the "export" keyword in the function declaration.

pinkfrog05:08:22

However, I got: joyride ERROR: Run Failed: Unexpected token 'export

pinkfrog05:08:05

Got it. Switching to "module.exports = {}" syntax now works.

pinkfrog05:08:38

Another question, using javascript, how can I log to the output channel of joyride?

pez06:08:48

I don’t know, tbh. We don’t have a JS API for importing CLJS things. Something for me an @U04V15CAJ to consider, I guess.

pez06:08:08

I guess you can try to export an init function/method to your JS module and call it from the CLJS script that requires the module. Passing in the things you want to interact with.

pinkfrog06:08:57

One more question, how can I force reload the util.js file?

pez06:08:58

If you have :reload on the require of it, it should force reload when you require. So evaluating that in the REPL should do it.