Fork me on GitHub
#clojurescript
<
2022-09-11
>
Fredrik Andersson08:09:48

I have a problem with a warning in no.en.core since a update to the latest Clojurescript version. Apparently it implements parseInt and parseLong which seems to be a part of the core libraries now. I'm running into this because I am dependent on cljs-http. Does anyone know of a patch or an alternative to cljs-http?

thheller08:09:21

updating the dependency should take care of it?

Fredrik Andersson08:09:04

the dependency is within cljs-http. Even if I knew what to change in the code, I can not update the clojars. So I would have to keep a fork of the code.

thheller09:09:13

if you just declare a direct dependency on no.en.core in your own dependencies that will override the dependency in cljs-http

thheller09:09:33

thus giving you the latest version while still working with cljs-http

Fredrik Andersson09:09:48

works great! thanks 😃

Fredrik Andersson11:09:39

I would like to use https://cljdoc.org/d/funcool/promesa/8.0.450/api/promesa.core#let but I suspect that I'm not requiring it the right way

(ns roaring.core
  (:require-macros [cljs.core.async.macros :refer [go]])
  (:require [cljs-http.client :as http]
            [cljs.core.async :refer [<!]]
            [clojure.string :as s]
            [goog.crypt.base64 :as base64]
            [promesa.core :as p]
            [fire.admin :as f]))

thheller11:09:37

and how do you use it? the require is correct

Fredrik Andersson11:09:18

(defn request-roaring-token [api-key api-secret]
  (p/let [response (token api-key api-secret)]
    (:body response)))

thheller11:09:37

that is also correct

Fredrik Andersson11:09:05

the problem is that response is a unresolved symbol

thheller11:09:53

how are you running this? just via REPL eval? in which case you might have not eval'd the ns form?

Fredrik Andersson11:09:01

maybe its just conjure that is messing with me

Fredrik Andersson11:09:39

no i'm refactoring my file

Fredrik Andersson11:09:03

but i have lots of errors in my code right now so this might be a symptom of other problems

Fredrik Andersson11:09:43

I'll clean it up and see if it solves the problem

Fredrik Andersson13:09:06

[:admin] Build failure:
The required JS dependency "worker_threads" is not available, it was required by "node_modules/write-file-atomic/index.js".

Dependency Trace:
	percap/admin/core.cljs
	roaring/core.cljs
	fire/admin.cljs
	node_modules/firebase-admin/lib/index.js
	node_modules/firebase-admin/lib/default-namespace.js
	node_modules/firebase-admin/lib/app/firebase-namespace.js
	node_modules/firebase-admin/lib/storage/storage.js
	node_modules/@google-cloud/storage/build/src/index.js
	node_modules/@google-cloud/storage/build/src/bucket.js
	node_modules/@google-cloud/storage/build/src/file.js
	node_modules/@google-cloud/storage/build/src/gcs-resumable-upload.js
	node_modules/configstore/index.js
	node_modules/write-file-atomic/index.js

Searched for npm packages in:
	/home/fredrik/src/percap-cljs/node_modules

See: 

Fredrik Andersson13:09:18

Does anyone know why this keeps happening? Sometimes it goes away and then it comes back again.

Fredrik Andersson13:09:44

ignore it, I found out what was causing it

john13:09:47

Best guess: you have two node versions and your ending up on an old one?

john13:09:51

oh, what was it

Fredrik Andersson13:09:21

i have both backend and frontend targets in my shadow-cljs. the frontend target was requiring a namespace that were referencing the firebase-admin module. Which isn't supported in front end environments

👍 1
john13:09:35

aaah yeah