This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-05-20
Channels
- # announcements (1)
- # aws (4)
- # babashka (9)
- # beginners (89)
- # biff (5)
- # cider (36)
- # clj-kondo (12)
- # cljfx (4)
- # clojure (65)
- # clojure-europe (11)
- # clojure-norway (16)
- # clojure-uk (4)
- # clojurescript (25)
- # clr (2)
- # community-development (2)
- # cursive (8)
- # datomic (9)
- # emacs (8)
- # fulcro (63)
- # holy-lambda (18)
- # hyperfiddle (32)
- # introduce-yourself (1)
- # lsp (1)
- # off-topic (9)
- # pedestal (6)
- # ring (10)
- # ring-swagger (3)
- # squint (26)
- # xtdb (3)
- # yamlscript (71)
Hello! Do any one know how to build shadow-cljs sub project from other dir? I have clj project in one dir and cljs in other, and i what to run build from build.clj Thanks!
Thanks!
@U05224H0W do you mean
(shell "cd ../subproject && npx shadow-cljs release app")
from build.clj?not a clue what this looks like in tools.build. never used it for anything yet. I think it has some helpers for this
one that would let you specify the working dir I'd presume, so there would be no need for the cd + &&
https://clojure.github.io/tools.build/clojure.tools.build.api.html#var-process seems to be it maybe
@U05224H0W thank you!
as i undertand build.api/process just running shell cmd as java.shell i have try
(sh "sh" "-c" "cd ../subproject && npx shadow-cljs release app")
and it worksI'd assume process
looks something like this and less sketchy IMHO
(b/process
{:command-args ["npx" "shadow-cljs" "release" "app"]
:dir "../subproject"})
that also works )
@U05224H0W is it any way to do some thing like?
(binding [shadow.api/project-root "../"]
(shadow.api/release :app))
Even if there was, you shouldn't do it since it'd require using the same classpath for build.clj
and for shadow-cljs.
Hello, I am facing one issue while developing a rest endpoint using reitit.ring
and it is throwing an error "`Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client`". Here is the code,
Endpoint:
(ring/ring-handler
(ring/router
[["/api"
["/globalconfig"
{:get handlers/config-handler}]]]))
Handler:
(defn config-handler
[{:keys [body]
:as request}
respond _]
(p/let [config-data (helper/get-app-property {:property-id "app-key"})] ;;Till this point working fine I see config details in the logs
(respond {:status 200 :body config-data})))
It is not retuning the actual configuration to the client and throwing above error in server. Could you please help me to fix the issue. Looking forward for your response. Thanks in Advance!What is the stacktrace of the error? What is the web server? Do you have any middleware?
Here is the stacktrace:
> Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
> at new NodeError (node:internal/errors:405:5)
> at ServerResponse.setHeader (node:_http_outgoing:648:11)
> at ServerResponse.writeHead (node:_http_server:381:21)
> at /Users/xxxxx/sde/development/xxxxx-xxxx-xxxx/.shadow-cljs/builds/functions/dev/out/cljs-runtime/macchiato/http.cljs:110:5
> at /Users/xxxxxx/sde/development/xxxxxx-xxxxx-xxxxx/.shadow-cljs/builds/functions/dev/out/cljs-runtime/macchiato/http.cljs:106:10
> at respond_SINGLEQUOTE_ (/Users/xxxxxx/sde/development/xxxxxx-xxxxx-xxxxx/.shadow-cljs/builds/functions/dev/out/cljs-runtime/reitit/ring.cljc:119:43)
> at /Users/xxxxxx/sde/development/xxxxxx-xxxxx-xxxxx/.shadow-cljs/builds/functions/dev/out/cljs-runtime/xxxxx_xxxxx/server/handlers.cljs:265:6
> at /Users/xxxxxx/sde/development/xxxxxx-xxxxx-xxxxx/.shadow-cljs/builds/functions/dev/out/cljs-runtime/xxxxxx_xxxxx.server.handlers.js:185:3
> at /Users/xxxxxx/sde/development/xxxxx-xxxxx-xxxxx/.shadow-cljs/builds/functions/dev/out/cljs-runtime/promesa/impl.cljc:86:30
> at processTicksAndRejections (node:internal/process/task_queues:95:5)
i Request to function failed: Error: socket hang up
We have middlewares but for this endpoint I did not add anything
Currently running the app locally with firebase emulators to develop in local first
@U2FRKM4TW Could you please suggest
Sounds like a Macchiato problem. Maybe this if you have an old version, maybe something else: https://github.com/macchiato-framework/macchiato-core/pull/39
Thanks @U2FRKM4TW for your help. There is an issue in body actually which fixed the issue (respond {:status 200 :body config-data})