Questions tagged [clojurescript-javascript-interop]

53 questions
0
votes
1 answer

How to import a shadow-cljs project into another shadow-cljs project with a different configuration

I currently have 2 shadow-cljs projects with 2 different ways to manage their dependencies to npm libraries. One uses the default shadow-cljs.edn configuration :js-options {:js-provider :shadow}, we will call it project A. The other, we will call it…
0
votes
0 answers

Sending file on server

A photo is taken using react-native-vision-camera, data about it (PhotoFile object) is placed in db Later, the path to the file is obtained, the name, type are filled in, translated into js and sent to the server But I get an error 500 from…
0
votes
2 answers

Why is shadow-cljs returning this error message on "Stale Output"? How to guarantee the watch for this building is running?

I am new to Clojure and not a pro in Javascript. I am watching the free part of the course on Reagent. Following the instructions on the course's repo, after doing the git clone and the npm install, the author indicates running $ npm run dev.…
0
votes
1 answer

How to handle stale state and get the latest value of it inside a function in react?

how can I get the latest value of config in doSomething function? Do I need to put all the state values to a ref and then access it everywhere with the latest value? Is there a better/alternative way of handling this? import React, { useState } from…
0
votes
1 answer

Unclear error from react-leaflet with shadow-cljs

I'm getting this error message when I compile code for production and deploy to server but not getting it locally. I'm stumped as to why I can't re-produce locally Uncaught TypeError: Cannot read properties of undefined (reading 'replace') at E…
0
votes
3 answers

Pedestal Doesn't serve static resource

I am trying to build on the Pedestal tutorial app available here. I am trying to add cljs functionality and trying to setup a unified clojurescript and clojure environment. My deps.edn file looks as follows: {:paths ["src"] :deps…
0
votes
1 answer

How do you append to a file in ClojureScript (on Node)?

How can you append to a local file using ClojureScript (running on Node)?
michaelrbock
  • 1,160
  • 1
  • 11
  • 20
0
votes
1 answer

How can you get the path to a user's home directory in Clojurescript running on Node?

You can't use ~ in paths for NodeJS functions because that's a bash-specific thing. So how do you get the path to a user's home directory in Clojurescript (on Node)?
michaelrbock
  • 1,160
  • 1
  • 11
  • 20
0
votes
1 answer

Clojurescript core.matrix aljabr implementation must be explicitly set

Using core.matrix in a ClojureScript project. For javascript interop I need aljabr as explained in https://github.com/mikera/core.matrix/wiki/Matrix-implementations After I try to specify the implementation (as I do with other Clojure…
0
votes
1 answer

ClojureScript turn a Javascript Map Iterator into a seq

I'm calling a Javascript library and getting a Map Iterator back (which in Javascript you use with for ... in) How do I turn this into a ClojureScript sequence so I can call for on it?
interstar
  • 26,048
  • 36
  • 112
  • 180
0
votes
1 answer

Issue in Clojurescript application when changing class strings

I'm having a strange problem with a bit of Clojurescript in my application. I pulled all the relevant pieces out into a small Leiningen Reagent application. Here's the relevant Hiccup: (defn current-page [] (fn [] (let [page (:current-page…
jwh20
  • 646
  • 1
  • 5
  • 15
0
votes
1 answer

In Clojurescript, how do I use AWS javascript SDK to list S3 buckets?

I am just getting started with Clojurescript. I wrote some clojurescript code to use the shared aws credentials file to initialize S3 client and list buckets . However my code does not work. (defn -main [arg1 arg2] (println "hello") (let[ creds…
0
votes
1 answer

Use sourcemap on browser onerror in ClojureScript on Crome

I have a error listener (set! (.-onerror js/window)(fn [message source lineno colno error]... like this on browser and it works well, but stacktrace and other fields are in JS. I would like it to be translated to ClojureScript. I guess source maps…
0
votes
1 answer

How to get CKEditor react component usable in ClojureScript

I cannot get CKEditor react component to work in ClojureScript project. When I try to use the component (ns simple.core (:require [reagent.core :as reagent] [re-frame.core :as rf] [clojure.string :as str] …
0
votes
1 answer

Real time audio processing in ClojureScript

I want to do real time audio processing in ClojureScript. The MDN documentation points me to the AudioWorkletProcessor Class, but from what I googled, there is no obvious way to inherit from a JavaScript Class in ClojureScript. Am I missing…